angular-docs-cn/integration/injectable-def/src/lib1.ts

11 lines
223 B
TypeScript
Raw Normal View History

import {Injectable, NgModule} from '@angular/core';
@NgModule({})
export class Lib1Module {}
@Injectable({providedIn: Lib1Module})
export class Service {
static instance = 0;
readonly instance = Service.instance++;
}