Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ngOnInit() {
- this.router.changes.subscribe(changes => {
- console.log('location info:', this.location.platformStrategy.path());
- });
- }
- ngOnInit() {
- this.router.changes.subscribe(changes => {
- this.updatePath();
- });
- }
- updatePath() {
- this.path = this.location.platformStrategy.path();
- console.log('path updated:', this.path);
- this.appRef.tick();
- }
- <li><a [routerLink]="['/chat']" [ngClass]="{ 'active': path == '/chat' }">Chat</a></li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement