Commit fe423a1a by GD-A-150752

navigate-back

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