global counter with service angular

Solutions on MaxInterview for global counter with service angular by the best coders in the world

showing results for - "global counter with service angular"
Martín
10 Feb 2018
1// shared.service.ts
2
3
4import { Injectable } from '@angular/core';
5
6@Injectable()
7
8export class SharedService {
9 
10 public count =0;
11
12setCount(countValue:number){
13  this.count+= countValue; 
14}
15getCount():number{
16  return this.count;
17}
18
19}