From 9b7c1d0f7ce442d4ad2ec587e66d2d335e64fa4e Mon Sep 17 00:00:00 2001 From: deboer Date: Fri, 8 Feb 2013 20:00:05 +0000 Subject: 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. --- src/ng/directive/ngSwitch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ng/directive/ngSwitch.js') diff --git a/src/ng/directive/ngSwitch.js b/src/ng/directive/ngSwitch.js index 24c6047a..7b698107 100644 --- a/src/ng/directive/ngSwitch.js +++ b/src/ng/directive/ngSwitch.js @@ -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, -- cgit v1.2.3