Browse Source

add: env provide section to environment documentation

pull/20477/head
masum-ulu 1 year ago
parent
commit
bc05e94bc3
  1. 16
      docs/en/framework/ui/angular/environment.md

16
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.

Loading…
Cancel
Save