https://github.com/angular/angular
Raw File
Tip revision: 03fc92d44825987ccda1422e0235fdd7176d16ea authored by Andrew Kushnir on 23 August 2023, 17:30:26 UTC
release: cut the v16.2.2 release
Tip revision: 03fc92d
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