Closed BinaryMuse closed 11 years ago
angular/angularjs-batarang#66 made me realize that there was a hole in the support for $get
in providers when the provider definition was provided as an object literal; this commit adds that support.
Looks good! Thanks @BinaryMuse.
Landed as a91b8fdf1eefb159311badb0861715ba999be9e5, 13bf914830216aa1a3da2937f9a9617cecf21404, and a2b79a5b4331c4d72674341fc1c5d1b3a93868dc. Published in v0.3.7
, which is now available on npm. Thanks again, @BinaryMuse!
Hi, Brian,
This pull request annotates
this.$get = function(dep)
in providers (#31). From the test, it transforms:into this:
It's based of the DDO annotation code in
lib/annotate-ast.js
. I've also included some refactoring in that file that extracts repeated code from inside the finaldeepApply
s into a functionannotateInjectables
(I'll let you decide on a decent name :) that takes the argument usually namedoriginalFn
and returns theArrayExpression
it should be replaced with (or else returnsoriginalFn
if nothing is to be annotated).