I figured, it was something like that. I eventually found the solution here 
- 
https://medium.com/engineering-on-the-incline/reloading-current-route-on-click-angular-5-1a1bfc740ab2
 
- by subscribing to the NavigationEnd event, I'm able to get the exact 
results I was looking for.  What I ended up with was this:


  constructor(
   private messageService: MessageService,
   private route: ActivatedRoute,
   private location: Location,
   private router: Router
 ) {

    this.router.events.subscribe((e:any) => {if(e instanceof NavigationEnd) 
{this.createView();}});
 }

  ngOnInit() {
   this.messageService.add('Default component initialized');
   this.messageService.add('NarrowView: ->' + this.NarrowView);
 }

  createView() {
   this.News = false;
   this.Disclaimer = false;
   this.About = false;
   this.FAQ = false;
   this.NarrowView = true;

    var currentView = this.route.snapshot.paramMap.get('view');
   
   if (currentView != null) { currentView = currentView.toLowerCase();}
   switch (currentView) {
     case 'news': this.News = true; break;
     case 'disclaimer': this.Disclaimer = true; this.NarrowView = false; 
break;
     case 'about': this.About = true; break;
     case 'faq': this.FAQ = true; this.NarrowView = false; break;
     default: this.News = true; break;
   }

    this.messageService.add('currentView:' + currentView);
   this.messageService.add('NarrowView: ->' + this.NarrowView);
 }




-Chris

On Sunday, February 25, 2018 at 4:26:35 AM UTC-5, Sander Elias wrote:
>
> Hi Chris,
>
> Without seeing the code, I would say that you are not subscribing to the 
> router, but only to the static snapshot. The router is providing an 
> observable, that you can subscribe to to update your view.
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to