Property Binding in Angular 4

Property Binding

Square blacked indicates this property binding.

—-Html file (servers.component)

<button class="btn btn-primary" [disabled]="allowNewServer">Add Server</button>

 

—-Ts file (app.component)

allowNewServer = false;

constructor() {
setTimeout(() => {
this.allowNewServer = true;
}, 2000);
}

After 2 second button will be enable.

Leave a Reply

Your email address will not be published. Required fields are marked *