Lazy loading is the technique where angular loads the Modules only on a need basis rather than all at once. It is also called on-demand loading. By default, Angular Loads the modules eagerly. Lazy Loading of Angular Modules reduces the initial load time of the app. We use the loadChilden method of the Angular Router to lazy load them when the user navigates to a route. In this article, we will show you how to implement lazy loading
The building blocks of Angular Applications consists of Components, Templates, Directives, Pipes, and Services. We build a lot of such blocks to create the complete application. As the application grows bigger in size managing these blocks become difficult. The Angular Provides a nice way organize these blocks in a simple and effectively using Angular modules (Also known as ngModules).
In this tutorial, we look at Angular Route Guards. The Angular supports several guards like CanActivate, CanDeactivate, Resolve, CanLoad, and CanActivateChild. These guards help us to secure the route or to perform some actions before navigating into a route or leaving the route. We look at all these in this tutorial on Route Guards by building an example angular guards application.
In this Angular 2 Services tutorial, we will show you how to build a simple component that fetches list of products from an Angular 2 Service and display it in our template.
Our components need to access to data. You can write data access code in each component, but that is very inefficient. The Best way is to create a single reusable code and use it to retrieve data in every component that needs it. That is exactly where services come in.