Environment import in Angular

Viewed 7416

I'm trying to import Angular environment.ts into a different module from the app.module, specifically:

  • src (Folder)
    • app (Folder)
      • Service (Folder)
        • service.module.ts (File) <-This is where I want to import the environment
      • app.module.ts (File)
    • environment (Folder)
      • environment.ts (File) <- File which I want to import

Inside app.module this works fine:

import { environment } from '../environments/environment';

Which doesn't work inside the service.module, I have also tried:

import { environment } from 'src/environments/environment';

import { environment } from '../environments/environment';

Any ideas of how can I make this work?

3 Answers
Related