angularjs 1.5 component dependency injection
You can inject services to component controller like this: angular.module(‘app.module’) .component(‘test’, { templateUrl: ‘views/someview.html’, bindings: { subject: ‘=’ }, controller: [‘$scope’, ‘AppConfig’, TestController] }); function TestController(scope, config) { scope.something = ‘abc’; } or like this: angular.module(‘app.module’) .component(‘test’, { templateUrl: ‘views/someview.html’, bindings: { subject: ‘=’ }, controller: TestController }); TestController.$inject = [‘$scope’, ‘AppConfig’] function TestController(scope, config) … Read more