Angular 6 Sharing Service... or not...
Angular 6 Sharing Service… or not…
Different ways to share Service instance in Angular 6.
Service instance shared across entire application.
Declare `providedIn: ‘root’` property of `@Injectable` decorator in the Service. Then inject service to component’s constructor as usual.
import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class Service1Service { constructor() { } }
Declare service…
View On WordPress















