0

For example - there's a table in which I enter some value and proceed to next page, but when I come back to the page again I want the values entered to be there. Currently I'm using this._location.back() but this doesn't show the changes rather refreshes the page.

Brij
  • 3
  • 1

1 Answers1

0

You can use a BehaviorSubject for communicating between different components throughout the app. You can define a data sharing service containing the BehaviorSubject to which you can subscribe and emit changes. Define a data sharing service

import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable()
export class DataSharingService {
    public isUserLoggedIn: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
}

See link for full solution here