Commit eb18c54b authored by Robert Knight's avatar Robert Knight

Fix a conflict between two Babel plugins

The transform-async-to-promises Babel plugin could end up inserting helper code
between the `@ngInject` comment and the associated function, breaking
the functionality of the angularjs-annotate Babel plugin. Work around
this by adding the `$inject` property to the function manually instead
of relying on the angularjs-annotate plugin to do it.

This issue only showed up locally when testing out a change to convert
the module's imports to ES module syntax.
parent 4c08e23f
...@@ -21,7 +21,6 @@ const serviceConfig = require('../service-config'); ...@@ -21,7 +21,6 @@ const serviceConfig = require('../service-config');
* Interaction with OAuth endpoints in the annotation service is delegated to * Interaction with OAuth endpoints in the annotation service is delegated to
* the `OAuthClient` class. * the `OAuthClient` class.
*/ */
// @ngInject
function auth( function auth(
$rootScope, $rootScope,
$window, $window,
...@@ -300,4 +299,17 @@ function auth( ...@@ -300,4 +299,17 @@ function auth(
}; };
} }
// `$inject` is added manually rather than using `@ngInject` to work around
// a conflict between the transform-async-to-promises and angularjs-annotate
// Babel plugins.
auth.$inject = [
'$rootScope',
'$window',
'OAuthClient',
'apiRoutes',
'flash',
'localStorage',
'settings',
];
module.exports = auth; module.exports = auth;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment