*However, I am trying...">

Angular js ng-disabled not working

This is my form

<form name="myForm"> <input ng-disabled="true" type="text" >* </form> 

However, I am trying to understand why this input field is not disabled?

I also tried using $ scope, so in CTRL:

 $scope.diss=true; 

and in html:

 <form name="myForm"> <input ng-disabled="diss" type="text" >* </form> 

It still doesn't work, any hint?

+6
source share
2 answers

Here is a simple working example of the ng-disabled directive:

 <form ng-app> <input ng-disabled="checked" type="text" /> Click me to disable: <input type="checkbox" ng-model="checked"><br/> </form> 
+8
source

I could not use ng-disabled with angular until version 1.2.x (I'm on 1.0.8) because my jQuery version was 1.4.2.

angularJS 1.0.x requires jQuery 1.6 or later.

Updating your jQuery or angularJS will fix the problem - angularJS 1.2.x detects your jQuery version and abandons the internal jQLite.

+1
source

All Articles