I've been trying to use the new Angular 1.5 component
syntax in a project, but I can't figure out how to inject a dependency into the component definition.
Here's my attempt at refactoring an existing directive to a component:
angular
.module('app.myModule')
.component('row', {
bindings: {
details: '@',
zip: '@'
},
controller: 'RowController',
templateUrl: basePath + 'modules/row.html' // basePath needs to be injected
})
For various reasons, we inject the constant basePath
into all of our directives as part of the templateUrl.
How do I do this on a component, since the component definition is not a function?