{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/2257","labels_url":"https://api.github.com/repos/babel/babel/issues/2257/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/2257/comments","events_url":"https://api.github.com/repos/babel/babel/issues/2257/events","html_url":"https://github.com/babel/babel/issues/2257","id":102846609,"number":2257,"title":"ngAnnotate with static methods","user":{"login":"CWSpear","id":495855,"avatar_url":"https://avatars.githubusercontent.com/u/495855?v=3","gravatar_id":"","url":"https://api.github.com/users/CWSpear","html_url":"https://github.com/CWSpear","followers_url":"https://api.github.com/users/CWSpear/followers","following_url":"https://api.github.com/users/CWSpear/following{/other_user}","gists_url":"https://api.github.com/users/CWSpear/gists{/gist_id}","starred_url":"https://api.github.com/users/CWSpear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CWSpear/subscriptions","organizations_url":"https://api.github.com/users/CWSpear/orgs","repos_url":"https://api.github.com/users/CWSpear/repos","events_url":"https://api.github.com/users/CWSpear/events{/privacy}","received_events_url":"https://api.github.com/users/CWSpear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-24T17:15:00Z","updated_at":"2015-08-24T19:30:20Z","closed_at":null,"body":"I'm using `gulp-babel` to compile assets, and I had a local version using `babel-core` `5.6.17`, and it was working correctly, but when I did a fresh `npm install`, it installed the latest: `5.8.21`.\r\n\r\nInput (as part of a class):\r\n\r\n```js\r\n/*@ngInject*/\r\nstatic productsCategoryProductRoute($stateProvider) {\r\n    $stateProvider\r\n        .state('products.category.product', {\r\n            url: '/:slug',\r\n            templateUrl: 'assets/products/category/products/product.detail.html',\r\n            controllerAs: 'ctrl',\r\n            controller: ProductDetailController,\r\n            resolve: {\r\n                product(api, $stateParams) {\r\n                    return api.one('products', $stateParams.slug).get();\r\n                },\r\n                cartReadyCheck(Cart) {\r\n                    Cart.onReady(angular.noop);\r\n                },\r\n            },\r\n            nav: { breadcrumb: '{{ product.name }}' },\r\n        });\r\n}\r\n```\r\n\r\nOutput with `5.6.17` (it does `babel` then `ng-annotate`):\r\n\r\n```js\r\n...\r\n}], [{\r\n    key: 'productsCategoryProductRoute',\r\n\r\n     /*@ngInject*/\r\n    value: [\"$stateProvider\", function productsCategoryProductRoute($stateProvider) {\r\n        $stateProvider.state('products.category.product', {\r\n            url: '/:slug',\r\n            templateUrl: 'assets/products/category/products/product.detail.html',\r\n            controllerAs: 'ctrl',\r\n            controller: ProductDetailController,\r\n            resolve: {\r\n                product: [\"api\", \"$stateParams\", function product(api, $stateParams) {\r\n                    return api.one('products', $stateParams.slug).get();\r\n                }],\r\n                cartReadyCheck: [\"Cart\", function cartReadyCheck(Cart) {\r\n                    Cart.onReady(angular.noop);\r\n                }]\r\n            },\r\n            nav: { breadcrumb: '{{ product.name }}' }\r\n        });\r\n    }]\r\n}], [{\r\n...\r\n```\r\n\r\nOutput with `5.8.21`:\r\n\r\n```js\r\n...\r\n    /*@ngInject*/\r\n}], [{\r\n    key: 'productsCategoryProductRoute',\r\n    value: function productsCategoryProductRoute($stateProvider) {\r\n        $stateProvider.state('products.category.product', {\r\n            url: '/:slug',\r\n            templateUrl: 'assets/products/category/products/product.detail.html',\r\n            controllerAs: 'ctrl',\r\n            controller: ProductDetailController,\r\n            resolve: {\r\n                product: [\"api\", \"$stateParams\", function product(api, $stateParams) {\r\n                    return api.one('products', $stateParams.slug).get();\r\n                }],\r\n                cartReadyCheck: [\"Cart\", function cartReadyCheck(Cart) {\r\n                    Cart.onReady(angular.noop);\r\n                }]\r\n            },\r\n            nav: { breadcrumb: '{{ product.name }}' }\r\n        });\r\n    }\r\n}], [{\r\n...\r\n```\r\n\r\nNote that because `/*@ngInject*/` is no longer on the line above the function definition, `ng-annotate` can't do its thing.\r\n\r\nI know just how much you love `ng-annotate`, but figured I should bring it to your attention.\r\n\r\n--\r\n\r\n**Edit**: As @olov commented, I accidentally pasted the same output twice, and I have fixed that now."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/134349076","html_url":"https://github.com/babel/babel/issues/2257#issuecomment-134349076","issue_url":"https://api.github.com/repos/babel/babel/issues/2257","id":134349076,"user":{"login":"olov","id":19247,"avatar_url":"https://avatars.githubusercontent.com/u/19247?v=3","gravatar_id":"","url":"https://api.github.com/users/olov","html_url":"https://github.com/olov","followers_url":"https://api.github.com/users/olov/followers","following_url":"https://api.github.com/users/olov/following{/other_user}","gists_url":"https://api.github.com/users/olov/gists{/gist_id}","starred_url":"https://api.github.com/users/olov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olov/subscriptions","organizations_url":"https://api.github.com/users/olov/orgs","repos_url":"https://api.github.com/users/olov/repos","events_url":"https://api.github.com/users/olov/events{/privacy}","received_events_url":"https://api.github.com/users/olov/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T19:30:20Z","updated_at":"2015-08-24T19:30:20Z","body":"Thanks for the update. My advice is still to change `/*@ngInject*/ static productsCategoryProductRoute($stateProvider) { ...` to \r\n`static productsCategoryProductRoute($stateProvider) { \"ngInject\"; ... }` so you don't have to rely on Babel preserving comments. If you want more help on ng-annotate then just open up an issue on it."}}