show hide angular code example
Example 1: angular.io hide
<div [style.visibility]="(numberOfUnreadAlerts == 0) ? 'hidden' : 'visible' ">
COUNTER: {{numberOfUnreadAlerts}}
</div>
Example 2: angular hide element from component when on certain page
// in .component.ts file
import { Router } from '@angular/router';
export class ExampleComponent {
constructor(private _router: Router) {}
}
// in html file
<footer *ngIf="_router.url != '/your-route'"></footer>