From bc05e94bc37756b8d8134969dcaa4dade0ff1bc4 Mon Sep 17 00:00:00 2001 From: masum-ulu Date: Thu, 3 Oct 2024 16:22:07 +0300 Subject: [PATCH] add: env provide section to environment documentation --- docs/en/framework/ui/angular/environment.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/en/framework/ui/angular/environment.md b/docs/en/framework/ui/angular/environment.md index 33f53b7836..7fd1b1273a 100644 --- a/docs/en/framework/ui/angular/environment.md +++ b/docs/en/framework/ui/angular/environment.md @@ -101,6 +101,22 @@ export interface RemoteEnv { - `method`: HTTP method to be used when retrieving environment config. Default: `GET` - `headers`: If extra headers are needed for the request, it can be set through this field. +## Provide Environment Variable to Core Module + +`environment` variable comes from angular host application. + +```js +import { environment } from '../environments/environment'; + +@NgModule({ + imports: [ + //...other imports + CoreModule.forRoot({ + environment + }), + ] +}) +``` ## EnvironmentService ` EnvironmentService` is a singleton service, i.e. provided in root level of your application, and keeps the environment in the internal store.