I am trying to set up a component with a templateURL that is a relative path given a configuration module. However, since it is outside of a controller, I can't figure out how to bring in the dependency to the configuration
app.config.js:
angular.module('app.config', [])
.constant('config', {
TEMPLATES_URL: 'js_2/templates/',
COMPONENTS_URL: 'js_2/components/'
})
home.app.js :
angular.module('home.app', ['rest.service', 'app.config']);
home.component.js:
angular.module('home.app').component('home', {
/* HOW DO I INJECT THE 'config' DEPENDENCY */
templateUrl: config.TEMPLATES_URL + 'home.template.html',
controller: ....})
I know that when injecting into a controller you would simply inject 'config' and use it, but I don't know how to do this to a component
Thank you