Kann ich ng-readonly Direktive in einem Kontrollkästchen verwenden?ng-readonly funktioniert nicht in angular checkbox
Das Kontrollkästchen ist schreibbar, auch wenn es mit ng-readonly dekoriert ist.
Html:
<input type="checkbox" ng-model="model" ng-readonly="test" /> {{model}}
Controller:
myApp.controller('MyCtrl', function($scope) {
$scope.test = true;
});
Added Fiddle
add ng-Modell Ihrem Eingabefeld –
noch nicht ‚Arbeits –
Aparently ng-Nur-Lese nicht ist Wenn Sie für Checkboxen arbeiten, können Sie [ng-disabled] (https://docs.angularjs.org/api/ng/directive/ngDisabled) verwenden. – AntiHeadshot