from stack overlow.
The BC controller module <https://gist.github.com/vojtajina/1649788> is shorthand for Backward Compatability. Load this module to enable old-style controllers, where controller and scope are mixed together. This module decorates Angular's $controller service: - if given controller does not ask for $scope, it instantiates it in old-way - if given controller does ask for $scope, instantiation is delegated to default $controller service. This also allows migrating apps step by step. So, the default angular modules always ask for the $scope reference even if they do not intend to use it, to avoid being instantiated for BC. El domingo, 7 de septiembre de 2014 23:51:41 UTC-3, Emanuel Vecchio escribió: > > In the source code of the directive ngSwitch and FromController you can > see this comment. > > // asks for $scope to fool the BC controller module > > what kind of cheating is it? why is it used? > > https://github.com/angular/angular.js/blob/master/src/ng/directive/ngSwitch.js#L136 > > https://github.com/angular/angular.js/blob/master/src/ng/directive/form.js#L53 > > Thanks > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
