aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArtemy Tregubenko <me@arty.name>2014-05-09 18:09:38 +0200
committerArtemy Tregubenko <me@arty.name>2014-05-11 14:01:08 +0200
commit524a8a42a4c8d136a8f33739f8fea58ce78dd92c (patch)
treed159b8ea09eb41058da4916298f27412d92179a7 /test
parentc3087dd179bcef93626ae8227bf8f0ac5baa15a2 (diff)
downloadtracifyjs-524a8a42a4c8d136a8f33739f8fea58ce78dd92c.tar.gz
tracifyjs-524a8a42a4c8d136a8f33739f8fea58ce78dd92c.zip
added @ngInject support for inline functions
Diffstat (limited to 'test')
-rw-r--r--test/compress/angular-inject.js67
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