Posts

Showing posts from December, 2022

Angular Router

Image
In Previous topic we have looked into HTTP Client in Angular , In this topic we will look routing mechanism in Angular. we will set up and configure router. Routing ➤➤ Routing allow us to navigate from one component to another based on action taken by users. The Angular router module is a separate module which is present in @angular/router package. Configure Angular Router : Angular Router is configured automatically when we create a new application using Angular CLI. If you want to do it manually you need to follow below steps. 1. Base href tag: you have to place <base href="/"> inside index.html within the head tag as shown below. <!doctype html > <html lang = "en" > <head>   <meta charset = "utf-8" >   <title> SchoolManagementSystem </title>   <base href = "/" >   <meta name = "viewport" content = "width=device-width, initial-scale=1" >   <link rel = "icon...

Angular HTTP Client

Image
In Previous topic we look into Service & Dependency Injection  in Angular. In this topic we will look into Angular HTTP Client. Before looking into the HTTP clients you have to create one angular application. You can refer below URL's for installing for installing Nodes, visual Studio, Angular CLI and create Angular Application. Install NodeJs & Visual Studio Install Angular CLI Create Angular Application HTTP Client ➤➤ HTTP Client is a built in Service available in  from '@angular/common/http'  package. It uses the RxJS Observable based API's which means it returns the observable and what we need to subscribe it. RxJS Observable ➤➤ An Observable is an object that helps to manage async code. So to use it we need observable library called RxJS(Reactive Extension for JavaScript). RxJS is a library for reactive programming using observables that makes it easier to compose async code. Angular uses observables as interface to handle the common asynchronous operatio...