Thuta Learning
BasicWeb Developmentintermediate

Property Binding [ ]

Relax. We'll talk through this in plain words — no textbook voice.

Property Binding [ ] lets you bind an HTML element's property (e.g., src, disabled) to data in the component. Data flows one-way, from the component to the template.

typescript
<img [src]="imageUrl">
<button [disabled]="isButtonDisabled">Click Me</button>

// component.ts
export class MyComponent {
  imageUrl = 'path/to/image.jpg';
  isButtonDisabled = true;
}
You should see
(An image will appear, and the button will be disabled)
Property Binding [ ] | Thuta Learning