angular/packages/compiler-cli/integrationtest/bazel/injectable_def/lib2/module.ts
Matthieu Riegler 09df589e31 refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160)
All components, directives and pipes will now use standalone as default.
Non-standalone decorators have now `standalone: false`.

PR Close #58160
2024-10-14 14:58:57 +00:00

32 lines
770 B
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {Component, Injector, NgModule} from '@angular/core';
import {Lib1Module, Service} from 'lib1_built/module';
@Component({
selector: 'lib2-cmp',
template: '{{instance1}}:{{instance2}}',
standalone: false,
})
export class Lib2Cmp {
instance1: number = -1;
instance2: number = -1;
constructor(service: Service, injector: Injector) {
this.instance1 = service.instance;
this.instance2 = injector.get(Service).instance;
}
}
@NgModule({
declarations: [Lib2Cmp],
exports: [Lib2Cmp],
imports: [Lib1Module],
})
export class Lib2Module {}