I have the following lines:
var app = angular.module('app', []);
app.constant("const", {
foo: "bar",
test: "123"
});
I would like to now access the information in constant directly from the module app. Something like this didn't work:
console.log(app.constant.const.foo);
I know you can inject constants into controllers, services etc and access the information but for my purposes, I would like to access them straight off the module.
Is the only way to access a registered constant is to inject it into a controller/service/etc?