Skip to content

Commit

Permalink
Fix annotations to work with strictDI
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Jul 19, 2016
1 parent 3869606 commit d2ab134
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/authProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ export default class AuthProvider {
};
}
}

AuthProvider.prototype.$get.$inject = ['SatellizerShared', 'SatellizerLocal', 'SatellizerOAuth'];
2 changes: 2 additions & 0 deletions src/interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ export default class Interceptor implements angular.IHttpInterceptor {
return config;
};
}

Interceptor.Factory.$inject = ['SatellizerConfig', 'SatellizerShared', 'SatellizerStorage'];
2 changes: 1 addition & 1 deletion src/ng1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ angular.module('satellizer', [])
.service('SatellizerOAuth1', OAuth1)
.service('SatellizerStorage', Storage)
.service('SatellizerInterceptor', Interceptor)
.config(($httpProvider) => new HttpProviderConfig($httpProvider));
.config(['$httpProvider', ($httpProvider) => new HttpProviderConfig($httpProvider)]);

export default 'satellizer';

15 changes: 15 additions & 0 deletions test/annotations.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import satellizer from './../src/ng1';

describe('angular annotations', () => {

beforeEach(angular.mock.module(satellizer));

beforeEach(() => {
angular.mock.inject.strictDi(true);
});

it('should create the injector without errors', angular.mock.inject(['$auth', ($auth) => {
expect($auth).toBeTruthy();
}]));

});

0 comments on commit d2ab134

Please sign in to comment.