Share Angular Environment Variables in Nx
// app.module.ts
import { environment } from '../environments/environment';
@NgModule({
providers: [
{
provider: 'ENVIRONMENT',
useValue: environment,
},
],
})
class AppModule {}
// libs/../my-component.component.ts
@Component({...})
class MyComponent {
constructor(@Inject('ENVIRONMENT') environment: object) {}
}