简体   繁体   English

Angular js ng-disabled不起作用

[英]Angular js ng-disabled doesnt work

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 with a $scope, so in the CTRL: 我也试过$ scope,所以在CTRL中:

$scope.diss=true;

and in html : 并在HTML中:

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

It still doesnt work, any hint? 它仍然无法工作,任何提示?

Here's a simple working example of the ng-disabled directive: 这是ng-disabled指令的简单工作示例:

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

I could not use ng-disabled with angular prior to version 1.2.x (I am on 1.0.8) because my jQuery version was 1.4.2. 因为我的jQuery版本是1.4.2,所以我无法在版本1.2.x(我在1.0.8之前)使用ng-disabled和angular。

angularJS 1.0.x requires jQuery 1.6 or newer. angularJS 1.0.x需要jQuery 1.6或更新版本。

Upgrading either your jQuery or angularJS will fix the issue - angularJS 1.2.x detects your jQuery version and will fallback to its internal jQLite. 升级你的jQuery或angularJS将解决这个问题 - angularJS 1.2.x检测你的jQuery版本并将回退到它的内部jQLite。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM