Commit fe423a1a by GD-A-150752

navigate-back

parent 9e630ff1
......@@ -12,7 +12,7 @@
</div>
<div *ngIf="!embedded" class="main-tab-template pl-1">
<div class="chief-officer mb-0">
<a [routerLink]="[previousUrl]" class="arrow-btn-blue ml-0">
<a (click)="goBack()" class="arrow-btn-blue ml-0">
<img src="assets/images/arrow-left-prev_blue.svg" alt="Back">
</a>
{{heading}}
......@@ -108,7 +108,7 @@
<div class="ui-g-12 ui-md-12">
<div class="main-tab-template pl-1 {{embedded ? 'h-45' : '' }}">
<div class="chief-officer mb-0">
<a [routerLink]="[previousUrl]" class="arrow-btn-blue ml-0" *ngIf="!embedded">
<a (click)="goBack()" class="arrow-btn-blue ml-0" *ngIf="!embedded">
<img src="assets/images/arrow-left-prev_blue.svg" alt="Back">
</a>
{{heading}}
......
import { Location } from '@angular/common';
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { MenuItem } from 'primeng/api';
import { Editor } from 'primeng/editor';
import { FileUpload } from 'primeng/fileupload';
......@@ -46,7 +47,6 @@ export class MessageEngineComponent extends BaseComponent implements OnInit {
apiUrl = environment.baseUrl;
loggedInId = null;
showLoader = false;
previousUrl: string;
heading = '...';
constructor(
......@@ -57,15 +57,16 @@ export class MessageEngineComponent extends BaseComponent implements OnInit {
private appService: AppService,
private messageEngineService: MessageEngineService,
private adminPortalLayoutService: AdminPortalLayoutService,
private applicantPortalLayoutService: ApplicantPortalLayoutService
private applicantPortalLayoutService: ApplicantPortalLayoutService,
private location: Location
) {
super(utilsService);
// In order to get previous url for navigation
router.events
.filter(event => event instanceof NavigationEnd)
.subscribe((e: any) => {
this.previousUrl = e.url;
});
}
goBack(): void {
if (window.history.length > 1) {
this.location.back();
}
}
ngOnInit(): void {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment