I am using the Yeoman angular-fullstack generator .
I want to access some environment variables in the front-end controller ( main.controller.js). The only way I know how to set environment variables is this:
server / config / environment / local.env.js
'use strict';
module.exports = {
DOMAIN: 'hidden',
SESSION_SECRET: "hidden",
DEBUG: 'hidden',
CALENDAR_ID: 'hidden',
API_KEY: 'hidden'
};
However, from what I understand, this only makes it available on the server, but I want it on the front side. The following do not work in my front controller: ENV.API_KEYand process.env.API_KEY.
What should I do?
source
share