constructor(private router: Router
, private ref: ChangeDetectorRef
)
{
this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
map(() => this.rootRoute(this.route))
).subscribe((route: ActivatedRoute) => {
let tempusSuccessResponse = this.route.snapshot.queryParamMap.get('TRANSUCCESS');
let val = tempusSuccessResponse ? tempusSuccessResponse.toUpperCase() === 'TRUE' : false
this.creditCardSubmitSuccess = val;
if (val) {
let tempusTokenResponse = this.route.snapshot.queryParamMap.get('REPTOKEN');
let val1 = tempusTokenResponse ? tempusTokenResponse : '';
this.creditCardToken = val1;
}
this.emitter.next(val)
alert(this.creditCardSubmitSuccess + ' ' + this.creditCardToken);
});
}
I have the above code where I’m pulling query params out of the router. I’m trying to set a boolean value in the front end based on what I get back out of the query params. I can succesfully make the call and alert the creditCardSubmitSuccess and see that I do indeed get back a true response along with a token. I have the creditCardSubmitSuccess variable tied to an *ngif in the html that always displays false. I can’t get it to update.
I have tried using a BehaviorSubject and Observables. I have also tried messing with ChangeDetectorRef. I’m not having any luck.