Using Resolver for pre-fetching data in Angular

Angular router package already has all the required functionality which a generic Single Page Application needs. In this article, I would like to discuss Resolver which is part of Angular Router. There are a few use cases where our page needs the data each time the routes get loaded. It could be statically (passing hardcoded or fixed data) or dynamically (loading data from the server). Along with this, we also want that if the data is not found for that specific page then we do not want to visit it and get navigated to some other route or page. Typically use case would be loading a page that contains a user's data but let's say no data is found for that specific user then we want to navigate the application to the edit the details page.
Using Resolver for pre-fetching data in Angular

Setting a basic Routing and Navigation in Angular

The way we navigate in an SPA(Single Page Application) is totally different from navigation we have been doing in our old traditional application. If you observe the difference between these two, you would find that applications with a Single Page have much better user experience as the pages served by the application would be much faster than traditional apps where the pages have to be requested from the server each time user makes requests.
Setting a basic Routing and Navigation in Angular

Using Template Reference variables in Angular 7

This article is all about Template Reference variable or Local Reference variable, whatever you can say. I think you can get some idea with the name itself “Template Reference” which says we are looking forward to putting a reference to any template.
Using Template Reference variables in Angular 7

Creating our own Structural Directive in Angular

Have you ever wondered, why do we place * with the structural directives like *ngFor, *ngIf, *ngSwitchCase because this indicates angular that these are structural directives. Structural directives with start(*) are the pretties way to use them but behind the scenes, angular transform them into something else. Lets figure out.
Creating our own Structural Directive in Angular

Creating a custom basic Attribute Directive in Angular

In my previous post, we gone through Directive in Angular and their types. I admit that it was not a deep article about directive but we can explore it in this article. Now will try creating our own basic attribute directive and will also learn how could we create it better. For that, we will start with a basic project setup. So, Let us do it.
Creating a custom basic Attribute Directive in Angular

Going through directives in Angular

Let’s take a tour of Angular directives. Since, it is one of the most important functionality of Angular, we should surely dive in to understand it in better way. We will also make our own directives which will instruct the DOM element to show some behavior on which it is being attached.
Going through directives in Angular

Lets understand Call(), Apply(), Bind() in JavaScript

In your daily life of programming, you must have gone through call(), apply() and bind() methods while dealing with functions. Lets understand one by one.
Lets understand Call(), Apply(), Bind() in JavaScript

How does Angular gets rendered on webserver?

How does our browser or server hosting our application know that it should render the content of our app component html here. Actually it is not the file get served by our server, instead the “index.html” file served by the server. Since angular is a framework which allow you to create single page application, this is the single page.
How does Angular gets rendered on webserver?
Rohit Sharma

Hi There! My name is Rohit and I am working in the one of MNC as Web Apps developer. I have been in this tech industry for last 5.6 years. This blog is just a part of my career journey.
Ready to make new mistakes without repeating the previous ones.

"All life is an experiment. The more experiments you make the better"


© 2021 WriteSomeCode. All Right Reserved. A Rohit Sharma Blog. Creative Commons License licensed under a Creative Commons Attribution 4.0 International License