Question · Cours Angular · Module 2: Composants
@Input obligatoire
Comment marque-t-on un @Input comme obligatoire, selon la leçon ?
Réponses possibles
- @Input({ required: true }) clan!: string;
- @Input(required) clan: string;
- @Required @Input() clan: string;
- @Input() clan: string = required;
Afficher la réponse
Bonne réponse :
- @Input({ required: true }) clan!: string;