Answers for "global counter with service angular"

0

global counter with service angular

// shared.service.ts


import { Injectable } from '@angular/core';

@Injectable()

export class SharedService {
 
 public count =0;

setCount(countValue:number){
  this.count+= countValue; 
}
getCount():number{
  return this.count;
}

}
Posted by: Guest on August-22-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language