bindings angularjs code example
Example 1: angular binding
<input [disabled]="condition ? true : false">
<input [attr.disabled]="condition ? 'disabled' : null">
Example 2: angular property binding
// component.ts
@Component({
templateUrl: 'component.html',
selector: 'app-component',
})
export class Component {
name = 'Peter';
updateName() {
this.name = 'John';
}
}