diff options
| author | Gias Kay Lee | 2014-01-07 21:25:46 +0800 | 
|---|---|---|
| committer | Tobias Bosch | 2014-01-07 16:54:35 -0800 | 
| commit | 5df7e73adf56ff4b776232fdb631e0f7d004864f (patch) | |
| tree | 1462aaaadcaee2f93195ee63f323452d534a4168 /src/ng/directive/ngSwitch.js | |
| parent | e115342fce6094db3d07e0bdd0b19e29cc0dd9c3 (diff) | |
| download | angular.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/ngSwitch.js')
| -rw-r--r-- | src/ng/directive/ngSwitch.js | 8 | 
1 files changed, 3 insertions, 5 deletions
| diff --git a/src/ng/directive/ngSwitch.js b/src/ng/directive/ngSwitch.js index 99832fc8..459669a2 100644 --- a/src/ng/directive/ngSwitch.js +++ b/src/ng/directive/ngSwitch.js @@ -168,11 +168,9 @@ var ngSwitchWhenDirective = ngDirective({    transclude: 'element',    priority: 800,    require: '^ngSwitch', -  compile: function(element, attrs) { -    return function(scope, element, attr, ctrl, $transclude) { -      ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []); -      ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element }); -    }; +  link: function(scope, element, attrs, ctrl, $transclude) { +    ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []); +    ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });    }  }); | 
