javascript - How to disable an input box using angular.js -
i using field edit view , create view
<input data-ng-model="userinf.username" class="span12 editemail" type="text" placeholder="me@example.com" pattern="[^@]+@[^@]+\.[a-za-z]{2,6}" required />
in controller have code disable input element:
function($rootscope, $scope, $location, userservice) { //etc $(".editemail" ).attr("disabled", disable); // no idea how in angular }
please help.
use ng-disabled or special css class ng-class
<input data-ng-model="userinf.username" class="span12 editemail" type="text" placeholder="me@example.com" pattern="[^@]+@[^@]+\.[a-za-z]{2,6}" required ng-disabled="{expression or condition}" />
Comments
Post a Comment