I need to show some content on certain page, in other pages it shouldn\'t be visible. How do I achieve it ? it doesn\'t work
*ngIf=\"[routerLink]=\"[\'/home\']\"<
I'm using the other approach.
template:
.ts file:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit {
constructor(private router: Router) {}
ngOnInit() {}
isHomeRoute() {
return this.router.url === '/';
}
}