https://github.com/angular/angular
Raw File
Tip revision: 33639db911fcfe08c22ca1559cb55dd14b9f9d3e authored by Andrew Kushnir on 19 November 2020, 19:34:21 UTC
release: cut the v11.0.2 release
Tip revision: 33639db
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