angular binding
<input [disabled]="condition ? true : false">
<input [attr.disabled]="condition ? 'disabled' : null">
angular binding
<input [disabled]="condition ? true : false">
<input [attr.disabled]="condition ? 'disabled' : null">
Bidirectionnal model binding
content_copy
<app-sizer [(size)]="fontSizePx"></app-sizer>
property binding angular documentation
// component.ts
@Component({
templateUrl: 'component.html',
selector: 'app-component',
})
export class Component {
name = 'Peter';
updateName() {
this.name = 'John';
}
}
// component.html
<p>My name is {{name}}</p>
<button (click)="updateName()">Update button</button>
angular property binding
// component.ts
@Component({
templateUrl: 'component.html',
selector: 'app-component',
})
export class Component {
name = 'Peter';
updateName() {
this.name = 'John';
}
}
angular property binding
import { Component } from "@angular/core";
@Component({
selector: 'app-example',
template: `
<div>
<input [value]='myText'></span>
</div>
`
})
export class AppComponent {
myText: string = "Hello World";
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us