app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
isError:boolean = false;
}
app.component.html
<h2>Angular If Else Condition</h2>
<div *ngIf="isError;else lorem_ipsum">
This document has error.
</div>
<ng-template #lorem_ipsum>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec tincidunt est quam, nec hendrerit nisl laoreet laoreet.
</ng-template>
- angular - Interpolation JavaScript method
- angular - Interpolation call method
- angular - Property binding example
- angular - How to use then else condition
- angular - Text input on change listener
- angular - How to get text input value
- angular - How to create a counter
- angular bootstrap - Dismissible alert
- angular bootstrap - Danger warning success alert
- angular bootstrap - Alert closed event
- angular bootstrap - Progressbar maximum value
- angular bootstrap - How to show striped Progressbar
- angular bootstrap - Light & dark Progressbar
- angular bootstrap - How to enable disable Datepicker
- angular bootstrap - Datepicker custom day style