# How to access CONSTANT value from different js file in AngularJS

constants.js file below

'use strict'

angular.module('app').constant('CONSTANT' {
"myValues": {
"fruit": "apple",
"car": "ford suv"
}


I would like to simply access “myValues” from

ang-extention.js file and simply use it like:

function getMyStuff() {
console.log(CONSTANT.myValues.fruit);
}


I tried:

angular.module(['CONSTANT', function(CONSTANT) {
console.log(CONSTANT.myValues.fruit');
}]);


but no luck. How is it done in this case?

I searched various terms for example, “how to use constants in angularJS” I read bunch of answers but i didn’t understand them so far and ended up asking SO myself.
Thank you so much in advance..

Source: New feed
Source Url How to access CONSTANT value from different js file in AngularJS