Issue
I have a component which contains 2 divs and i want to show only one div for eg: Show only div 1 on page /contact Show only div 2 on page /profile and /about
filter.component.html
//div 1
<div>
//some content
<div>
//div 2
<div>
//some content
<div>
Solution
ts file
constructor(public router: Router ) { }
html file
<div *ngIf="router.url == '/profile' || router.url == '/about'">A</div>
<div *ngIf="router.url == '/contact'">B</div>
Answered By - Luca Angrisani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.