diff options
author | Artemy Tregubenko <me@arty.name> | 2014-05-09 18:09:38 +0200 |
---|---|---|
committer | Artemy Tregubenko <me@arty.name> | 2014-05-11 14:01:08 +0200 |
commit | 524a8a42a4c8d136a8f33739f8fea58ce78dd92c (patch) | |
tree | d159b8ea09eb41058da4916298f27412d92179a7 /test | |
parent | c3087dd179bcef93626ae8227bf8f0ac5baa15a2 (diff) | |
download | tracifyjs-524a8a42a4c8d136a8f33739f8fea58ce78dd92c.tar.gz tracifyjs-524a8a42a4c8d136a8f33739f8fea58ce78dd92c.zip |
added @ngInject support for inline functions
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/angular-inject.js | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/test/compress/angular-inject.js b/test/compress/angular-inject.js new file mode 100644 index 00000000..1459361c --- /dev/null +++ b/test/compress/angular-inject.js @@ -0,0 +1,67 @@ +ng_inject_defun: { + options = { + angular: true + }; + input: { + /*@ngInject*/ + function Controller(dependency) { + return dependency; + } + } + expect: { + function Controller(dependency) { + return dependency; + } + Controller.$inject=['dependency'] + } +} + +ng_inject_assignment: { + options = { + angular: true + }; + input: { + /*@ngInject*/ + var Controller = function(dependency) { + return dependency; + } + } + expect: { + var Controller = function(dependency) { + return dependency; + } + Controller.$inject=['dependency'] + } +} + +ng_inject_inline: { + options = { + angular: true + }; + input: { + angular.module('a'). + factory('b', + /*@ngInject*/ + function(dependency) { + return dependency; + }). + directive('c', + /*@ngInject*/ + function(anotherDependency) { + return anotherDependency; + }) + } + expect: { + angular.module('a'). + factory('b',[ + 'dependency', + function(dependency) { + return dependency; + }]). + directive('c',[ + 'anotherDependency', + function(anotherDependency) { + return anotherDependency; + }]) + } +}
\ No newline at end of file |