AngularJS ng-checked Anweisung
AngularJS Beispiele
Wählen Sie ein oder wählen Sie alle Optionen:
<Body ng-app = "" >
<P> My: </ p >
<Input type = "checkbox" ng -Modell = "all"> Überprüfen Sie alle <br>
<Input type = "checkbox" ng -checked = "all"> Volvo <br>
<Input type = "checkbox" ng -checked = "all"> Ford <br>
<Input type = "checkbox" ng -checked = "all"> Mercedes
</ Body>
<P> My: </ p >
<Input type = "checkbox" ng -Modell = "all"> Überprüfen Sie alle <br>
<Input type = "checkbox" ng -checked = "all"> Volvo <br>
<Input type = "checkbox" ng -checked = "all"> Ford <br>
<Input type = "checkbox" ng -checked = "all"> Mercedes
</ Body>
Versuchen »
Definition und Verwendung
ng-checked Anweisung wird verwendet , um das Kontrollkästchen (Checkbox) oder ein Optionsfeld (Radio) des geprüften Attribut zu setzen.
Wennng-checked - Eigenschaft true zurückgibt, wird das Kontrollkästchen (Checkbox) oder ein Optionsfeld (Radio) ausgewählt werden.
Grammatik
<Input type = "checkbox | Radio " ng-checked = "Ausdruck"> </ input>
Typ Checkbox oder Funk an das <input> -Element unterstützt.
Parameter Wert
Wert | Beschreibung |
---|---|
Ausdruck | Wenn das stimmt, wird das Element Optionen aus. |