Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(ngSwitch): make ngSwitch compatible with controller BC module
Browse files Browse the repository at this point in the history
add a $scope to the ngSwitch's controller to fool the controller
BC (backwards compatibility) module used by DFA.
  • Loading branch information
deboer authored and IgorMinar committed Feb 14, 2013
1 parent 5548328 commit 9b7c1d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ng/directive/ngSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9b7c1d0

Please sign in to comment.