angularAMD icon indicating copy to clipboard operation
angularAMD copied to clipboard

Added route dependency injection for anonymous controllers

Open stargazer-2697 opened this issue 9 years ago • 2 comments

Fixes lost dependencies when routing with an anonymous controller. See discussion.

stargazer-2697 avatar Mar 16 '15 04:03 stargazer-2697

Hi,

Thanks for the pull request. Any reason to change the order of param in the test instead of changing the order of param in the angularAMD?

Sorry if I missed something obvious but day job is sucking every second of my life away at the moment.

marcoslin avatar Mar 17 '15 08:03 marcoslin

It's for simplicity really. The PR appends any local dependencies from config.resolve to the $inject property of the proxy controller. Since $scope is also a local dependency, I reordered the params so all the local dependencies will be adjacent. This way, I can simply iterate over arguments[2..n] instead of arguments[0] and then arguments[3..n].

stargazer-2697 avatar Mar 19 '15 07:03 stargazer-2697