The most apps need some sort of Runtime configuration information, which it needs to load at startup. For example, if your app requires data, then it needs to know the base location of your REST endpoints. This endpoints are not fixed and may have different values for development, testing & production.
The APP_INITIALIZER is an instance of InjectionToken. It is a built in Injection token provided by Angular. The Angular will execute the function provided by this token when the application loads. If the function returns the promise, then the angular will wait until the promise is resolved. This will make it ideal place to perform some initialization logic before the application is initialized.
In this Tutorial, we learn how best to organise the folder structure of an Angular Application. Finding the right folder structure for your real life Angular application is very important. As you add more and more features to your App locating the certain component or file becomes messy if you do not have the proper structure in place.
Angular Modules Angular Folder Structure In this tutorial, we will learn how to setup routing between multiple feature modules. In the previous tutorial on Angular Modules, we learnt how to create the multiple feature modules in a application. The Modules are core of any Angular apps. Our App will going to contain several such […]
The Angular Injector lives at the core of Angular Dependency injection system. In this article we will look at it in more detail. We will also take a look at the @Injectable & @Inject decorators.