This will be our first Angular service; we should be excited!
From Solution Explorer, navigate to the /ClientApp/app/ folder and create a /services/ subfolder within it. Right-click on the new folder and add an auth.service.ts TypeScript file; then, fill it with the following code (relevant lines are highlighted):
import { EventEmitter, Inject, Injectable, PLATFORM_ID } from "@angular/core";import { isPlatformBrowser } from '@angular/common';import { HttpClient, HttpHeaders } from "@angular/common/http";import { Observable } from "rxjs";import 'rxjs/Rx';@Injectable()export class AuthService { authKey: string = "auth"; clientId: string = "TestMakerFree"; constructor(private http: HttpClient, @Inject(PLATFORM_ID) private ...