I Have a TabService
that Inject Tabs Into mat-tab-groups
,
In Constructor I Inject Instance of Injector from @angular/core
constructor(
private loader: NgModuleFactoryLoader,
private injector: Injector
) {}
Then I use create method to create new tab or inject to existing like this:
private openInternal(newTab: OpenNewTabModel, moduleFactory?: NgModuleFactory<any>) {
const newTabItem: TabItem = {
label: newTab.label,
iconName: newTab.iconName,
component: {
componentType: newTab.componentType,
moduleFactory: moduleFactory,
injector: newTab.data
? Injector.create(newTab.data, this.injector)
: this.injector
}
};
I got this warning:
{
"resource": "/.../tab.service.ts",
"owner": "typescript",
"code": "1",
"severity": 4,
"message": "create is deprecated: from v5 use the new signature Injector.create(options) (deprecation)",
"source": "tslint",
"startLineNumber": 51,
"startColumn": 22,
"endLineNumber": 51,
"endColumn": 28
}
What is the new signature of Injector.create
?