https://github.com/angular/angular
Raw File
Tip revision: bab5f9a18f619b9c9f67c71113cdd13d5ff792ef authored by Andrew Kushnir on 03 November 2022, 23:38:55 UTC
release: cut the v14.2.9 release
Tip revision: bab5f9a
lib2.ts
import {Component, Injector, NgModule} from '@angular/core';
import {Lib1Module, Service} from 'lib1_built';

@Component({
  selector: 'test-cmp',
  template: '{{instance1}}:{{instance2}}',
})
export class TestCmp {
  instance1: number;
  instance2: number;

  constructor(service: Service, injector: Injector) {
    this.instance1 = service.instance;
    this.instance2 = injector.get(Service).instance;
  }
}

@NgModule({
  declarations: [TestCmp],
  exports: [TestCmp],
  imports: [Lib1Module],
})
export class Lib2Module {}
back to top