July 2018
Intermediate to advanced
420 pages
8h 46m
English
Let's create the file that will store the necessary code for our authentication module:
ng g service pages/auth/_services/auth
The previous command will create a new folder and file in ./app/pages/auth/_services/auth.service.ts. Now, let's add some pieces of code.
import { HttpClient, HttpParams, HttpErrorResponse } from '@angular/common/http'; import { HttpHeaders } from '@angular/common/http'; import { Router } from '@angular/router'; import { Observable, throwError } from 'rxjs'; import { catchError, map, tap } from 'rxjs/operators'; // App imports import ...Read now
Unlock full access