angular-cn/public/docs/_examples/dependency-injection/ts/app/logger.service.ts

12 lines
230 B
TypeScript

// #docregion
import { Injectable } from '@angular/core';
@Injectable()
export class Logger {
logs:string[] = []; // capture logs for testing
log(message: string){
this.logs.push(message);
console.log(message);
}
}