diff options
| author | Misko Hevery | 2010-04-07 17:24:24 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-04-07 17:24:24 -0700 |
| commit | e0ad7dfcd47196d0aa9271e84b2c4ac26cfda3f4 (patch) | |
| tree | f62565e7318ca6fe83520855292a29231b5f5970 /src/directives.js | |
| parent | a8aa5af413c068608aa28ef0d48cef1d5ad66485 (diff) | |
| download | angular.js-e0ad7dfcd47196d0aa9271e84b2c4ac26cfda3f4.tar.bz2 | |
seperatio validation and exception handling
Diffstat (limited to 'src/directives.js')
| -rw-r--r-- | src/directives.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/directives.js b/src/directives.js index 5cee0978..22ff7544 100644 --- a/src/directives.js +++ b/src/directives.js @@ -80,12 +80,17 @@ angularDirective("ng-bind-template", function(expression){ }; }); +var REMOVE_ATTRIBUTES = { + 'disabled':true, + 'readonly':true, + 'checked':true +}; angularDirective("ng-bind-attr", function(expression){ return function(element){ this.$onEval(function(){ foreach(this.$eval(expression), function(bindExp, key) { var value = compileBindTemplate(bindExp).call(this, element); - if (key == 'disabled' && !toBoolean(value)) { + if (REMOVE_ATTRIBUTES[lowercase(key)] && !toBoolean(value)) { element.removeAttr('disabled'); } else { element.attr(key, value); |
