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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -