https://github.com/angular/angular
Raw File
Tip revision: 64d94e8a6805c98d40b2763cbd6f6f1d8e1fd270 authored by Andrew Scott on 07 January 2021, 20:29:20 UTC
release: cut the v11.0.7 release (#40343)
Tip revision: 64d94e8
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