Posts

Showing posts with the label Angular Tutorial

Angular Observables

In Previous topic we have seen Angular Router and configure it. In this section we will take a look into Angular Observables. Angular Observable ➤➤ Angular Observable is a function that converts ordinary stream of data in Observable stream of data. In Order to use Observable we have to import "Observable" from "rxjs" into component that use it. import { Observable } from 'rxjs'; Observable emits the value from the stream asynchronously. It emits the complete signal when the stream completes or an error signal for any errors. The Observable starts to emit values only when someone subscribes to it. Important Points : Observables are sequence of data that gets emitted asynchronously from time to time or over period time it means that observable will keep producing values. Observable provide support for passing messages between different parts of our application. Angular make use of Observables as an interface to handle a variety of common async operations. Obse...

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...