aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/booleanAttrs.js
diff options
context:
space:
mode:
authorGias Kay Lee2014-01-07 21:25:46 +0800
committerTobias Bosch2014-01-07 16:54:35 -0800
commit5df7e73adf56ff4b776232fdb631e0f7d004864f (patch)
tree1462aaaadcaee2f93195ee63f323452d534a4168 /src/ng/directive/booleanAttrs.js
parente115342fce6094db3d07e0bdd0b19e29cc0dd9c3 (diff)
downloadangular.js-5df7e73adf56ff4b776232fdb631e0f7d004864f.tar.bz2
refactor(booleanAttrs, ngSwitch): use link function instead of compile function where appropriate
Replace two compile functions that immediately return a post-link function with link function definitions instead. Closes #5664
Diffstat (limited to 'src/ng/directive/booleanAttrs.js')
-rw-r--r--src/ng/directive/booleanAttrs.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js
index e6905820..30e57bdf 100644
--- a/src/ng/directive/booleanAttrs.js
+++ b/src/ng/directive/booleanAttrs.js
@@ -336,12 +336,10 @@ forEach(BOOLEAN_ATTR, function(propName, attrName) {
ngAttributeAliasDirectives[normalized] = function() {
return {
priority: 100,
- compile: function() {
- return function(scope, element, attr) {
- scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
- attr.$set(attrName, !!value);
- });
- };
+ link: function(scope, element, attr) {
+ scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
+ attr.$set(attrName, !!value);
+ });
}
};
};