Search results for "angular"


How can we cache the HTTP requests in Angular 10?

on October 27, 2020 🔥 0 views

Is it possible to cache the HTTP requests in the Angular 10 version public getPart(id: any): Observable { return this.http.get(`${this.baseUrl}${id}`) .pipe(map((res: any) => res.data)); }

discussion

Real-Time Notification With Socket.io, Angular 10 And NodeJS

on October 26, 2020 🔥 174732 views

In this tutorial, we will see how can we achieve Real-Time Notification With Socket.io, Angular 10, and NodeJS. With WebSocket, we are allowed for full-duplex communication between a server and clients. WebSocket with socket.io The WebSocket goes beyond the typical HTTP request/response paradigm. With WebSockets, the server and client can send data without initiating a […]

post

Best Way to Convert Angular 10 to Desktop App Using ElectronJS

on October 23, 2020 🔥 158124 views

In this tutorial, we will see what is the Best Way to Convert Angular 10 to Desktop App Using ElectronJS. Other than the PWA (Progressive Web App) we can also convert the angular app to an actual desktop app using the ElectronJS library. Angular 10 to Desktop App Using ElectronJS Using Electron we can easily […]

post

Answer for How to set the headers for every request in Angular?

on October 17, 2020 🔥 0 views

Add AuthInterceptor that will intercept all your HTTP requests and add the token to its headers: import { Injectable } from ‘@angular/core’; import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from ‘@angular/common/http’; import { Observable } from ‘rxjs’; @Injectable() export class AuthInterceptor implements HttpInterceptor { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { const token = localStorage.token; // […]

discussion

Answer for What is multicasting in angular and how to achieve multicasting?

on October 17, 2020 🔥 0 views

Multi-casting is the practice of broadcasting to a list of multiple subscribers in a single execution. Let’s demonstrate the multi-casting feature, var source = Rx.Observable.from([1, 2, 3]); var subject = new Rx.Subject(); var multicasted = source.multicast(subject); // These are, under the hood, `subject.subscribe({…})`: multicasted.subscribe({ next: (v) => console.log(‘observerA: ‘ + v) }); multicasted.subscribe({ next: (v) […]

discussion

How to set the headers for every request in Angular?

on October 16, 2020 🔥 0 views

How can I set the header in every request in angular? Let’s say I have token in localStorage and that needs to set for every REST API call.

discussion

What is multicasting in angular and how to achieve multicasting?

on October 16, 2020 🔥 0 views

How to use multicast of Rxjs in angular? It will be great if you can explain with an example.

discussion

How to use AsyncPipe in Angular?

on October 6, 2020 🔥 0 views

What is AsyncPipe in angular and how to use it? It will be great if someone can explain with an example.

discussion

Answer for How to use Wildcard route in Angular?

on October 5, 2020 🔥 0 views

If the URL doesn’t match any predefined routes then it causes the router to throw an error and crash the app. In this case, you can use a wildcard route. A wildcard route has a path consisting of two asterisks to match every URL. For example, you can define PageNotFoundComponent for wildcard route as below: […]

discussion

How to use Wildcard route in Angular?

on October 5, 2020 🔥 0 views

How to define wildcard route in angular? I have to show page not found component if the URL doesn’t match anything.

discussion