mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
fix(ngSwitch): make ngSwitch compatible with controller BC module
add a $scope to the ngSwitch's controller to fool the controller BC (backwards compatibility) module used by DFA.
This commit is contained in:
parent
5548328b67
commit
9b7c1d0f7c
1 changed files with 3 additions and 2 deletions
|
|
@ -63,9 +63,10 @@ var NG_SWITCH = 'ng-switch';
|
|||
var ngSwitchDirective = valueFn({
|
||||
restrict: 'EA',
|
||||
require: 'ngSwitch',
|
||||
controller: function ngSwitchController() {
|
||||
// asks for $scope to fool the BC controller module
|
||||
controller: ['$scope', function ngSwitchController() {
|
||||
this.cases = {};
|
||||
},
|
||||
}],
|
||||
link: function(scope, element, attr, ctrl) {
|
||||
var watchExpr = attr.ngSwitch || attr.on,
|
||||
selectedTransclude,
|
||||
|
|
|
|||
Loading…
Reference in a new issue