mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-19 03:51:07 +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
54a761905d
commit
ce3b616432
1 changed files with 3 additions and 2 deletions
|
|
@ -63,9 +63,10 @@ var NG_SWITCH = 'ng-switch';
|
||||||
var ngSwitchDirective = valueFn({
|
var ngSwitchDirective = valueFn({
|
||||||
restrict: 'EA',
|
restrict: 'EA',
|
||||||
require: 'ngSwitch',
|
require: 'ngSwitch',
|
||||||
controller: function ngSwitchController() {
|
// asks for $scope to fool the BC controller module
|
||||||
|
controller: ['$scope', function ngSwitchController() {
|
||||||
this.cases = {};
|
this.cases = {};
|
||||||
},
|
}],
|
||||||
link: function(scope, element, attr, ctrl) {
|
link: function(scope, element, attr, ctrl) {
|
||||||
var watchExpr = attr.ngSwitch || attr.on,
|
var watchExpr = attr.ngSwitch || attr.on,
|
||||||
selectedTransclude,
|
selectedTransclude,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue