Advertisement
Guest User

Untitled

a guest
May 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. ngOnInit() {
  2. this.router.changes.subscribe(changes => {
  3. console.log('location info:', this.location.platformStrategy.path());
  4. });
  5. }
  6.  
  7. ngOnInit() {
  8. this.router.changes.subscribe(changes => {
  9. this.updatePath();
  10. });
  11. }
  12.  
  13. updatePath() {
  14. this.path = this.location.platformStrategy.path();
  15. console.log('path updated:', this.path);
  16. this.appRef.tick();
  17. }
  18.  
  19. <li><a [routerLink]="['/chat']" [ngClass]="{ 'active': path == '/chat' }">Chat</a></li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement