Communication entre composants
Data Binding (rappel)
@Component({
selector: "app-root",
templateUrl: `<input [type]="inputType" (input)="onInputChanged()" />`,
})
class AppComponent {
inputType: "password" | "text" = "password";
onInputChanged() {}
}
Parent-Child components
Parent-Child components communication : Unidirectionnal
- Parent -> Child : Property Binding
- Child -> Parent : Event Binding
- Parent-Child communication (summary)