mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-15 22:34:17 +08: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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user