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:
deboer 2013-02-08 20:00:05 +00:00 committed by Igor Minar
parent 5548328b67
commit 9b7c1d0f7c

View file

@ -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,