What is property Binding in Angular 4
- Property binding allows you to define element attribute values from the component class.
- It is one-way data binding, as you can only set data from the component to the view.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<input type='text' value={{valueis}} />
<input type='text' [value]=valueis />
<input type='text' bind-value=valueis />
<input type='button' [disabled]=status value={{valueis}} />
`
})
export class AppComponent {
valueis='Click Me';
status=true;
}
