import { Injectable } from '@angular/core' ; import { LoggerService } from './logger.service' ; @ Injectable ( { providedIn : 'root' } ) export class CalculatorService { constructor ( private logger ) { } add ( n1 , n2 ) { this . logger . log ( "Addition operation called" ) ; return n1 + n2 ; } subtract ( n1 , n2 ) { this . logger . log ( "Subtraction operation called" ) ; return n1 - n2 ; } }