Skip to main content

angular - Property binding example

app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})

export class AppComponent {
  disabled3rd = true;
  disabled4th = false;
}
app.component.html

<h2>Angular Property Binding</h2>

<input type="text" value="" [disabled]=true/>
<br/><br/>

<input type="text" value="" [disabled]=false/>
<br/><br/>

<input type="text" value="" [disabled]="disabled3rd"/>
<br/><br/>

<input type="text" value="" [disabled]="disabled4th"/>
More Angular tutorials