https://github.com/angular/angular
Raw File
Tip revision: b11d3c375930103c11d9123bdb30555e2f53b380 authored by Alex Rickabaugh on 09 December 2021, 16:58:26 UTC
release: cut the v13.1.0 release (#44418)
Tip revision: b11d3c3
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