'Can I add netlify environment variables to my Angular app?

Angular has its own environment folder which has environment.ts and environment.prod.ts. I'm trying to host my Angular app but hide my api key in netlify, netlify has a nice environment variable feature where you place you api key with a name that you want, but how do I add this variable to my Angular app?

environment.prod.ts:

export const environment = {
  production: true,
  googleMapsApi: GOOGLE_NETLIFY
  ,
};

GOOGLE_NETLIFY is saved in my netlify deploy settings. Maybe I need to add this netlify.toml file but I can't find the right information for Angular and adding netlify variables with this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source