-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmy-feature.module.ts
28 lines (24 loc) · 1.17 KB
/
my-feature.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { ComponentRef, EnvironmentInjector, NgModule, createComponent } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MyComponent } from './my-component/my-component.component';
@NgModule({
declarations: [MyComponent],
imports: [CommonModule],
})
export class MyFeatureModule {
public constructor(private readonly _environmentInjector : EnvironmentInjector) { }
// this is used by one of the 4 methods that the shell uses to dynamically
// instantiate the MyComponent Angular component from this mfe1 app.
// See the `loadV2` method at /code-demos/component-ng16/shell-ng16/src/app/app.component.ts
public static readonly entryComponentType: typeof MyComponent = MyComponent;
// this is used by one of the 4 methods that the shell uses to dynamically
// instantiate the MyComponent Angular component from this mfe1 app.
// See the `loadV3` method at /code-demos/component-ng16/shell-ng16/src/app/app.component.ts
public getEntryComponent() : ComponentRef<MyComponent>
{
const createComponentOptions = {
environmentInjector: this._environmentInjector,
}
return createComponent(MyComponent, createComponentOptions);
}
}