Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ogm710811/app_initializer-hook-into-angular-bootstrap-process
the APP_INITIALIZER token provided by the Angular framework makes it easier to bootstrap Angular-based web apps.
https://github.com/ogm710811/app_initializer-hook-into-angular-bootstrap-process
Last synced: about 5 hours ago
JSON representation
the APP_INITIALIZER token provided by the Angular framework makes it easier to bootstrap Angular-based web apps.
- Host: GitHub
- URL: https://github.com/ogm710811/app_initializer-hook-into-angular-bootstrap-process
- Owner: ogm710811
- Created: 2019-09-26T04:09:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T22:59:11.000Z (almost 2 years ago)
- Last Synced: 2023-03-02T12:02:06.496Z (over 1 year ago)
- Language: TypeScript
- Size: 1.59 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to Use the APP_INITIALIZER Token to Hook Into the Angular Bootstrap Process
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.6.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Description
The APP_INITIALIZER token is used when you want to get the application's configuration details from an API and keep it ready before the application renders the page. For example, you would want to load the necessary language files before rendering any of the templates or you would want to resolve a remote API which provides information on the environment that the application is being run on. It's similar to how the resolve attribute in the router's configuration is used to get data from the remote API and feed it into the route's data source. In this case, the remote API is resolved first and then the application continues with the bootstrap process.
Here's an example of how the APP_INITIALIZER token is included in the application.