Browse Source

Fix old extensions loading: Force standalone false for componenents declared inside module.

pull/14935/head
Igor Kulikov 8 months ago
parent
commit
4187da12dc
  1. 19
      ui-ngx/src/app/core/services/resources.service.ts

19
ui-ngx/src/app/core/services/resources.service.ts

@ -32,7 +32,7 @@ import { forkJoin, from, Observable, ReplaySubject, throwError } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { IModulesMap } from '@modules/common/modules-map.models';
import { TbResourceId } from '@shared/models/id/tb-resource-id';
import { camelCase, isObject } from '@core/utils';
import { camelCase, isObject, isUndefined } from '@core/utils';
import { AuthService } from '@core/auth/auth.service';
import { select, Store } from '@ngrx/store';
import { selectIsAuthenticated } from '@core/auth/auth.selectors';
@ -287,6 +287,23 @@ export class ResourcesService {
module: moduleDef,
components: []
}
const declarationsDecl = moduleDef.declarations;
let declarations: Type<any>[];
if (Array.isArray(declarationsDecl)) {
declarations = declarationsDecl;
} else {
declarations = declarationsDecl();
}
if (declarations) {
for (const decl of declarations) {
if (ɵNG_COMP_DEF in decl) {
const component: ɵComponentDef<any> = decl[ɵNG_COMP_DEF];
if (isUndefined(component.standalone) || component.standalone) {
(component as any).standalone = false;
}
}
}
}
modulesWithComponents.modules.push(moduleInfo);
const exportsDecl = moduleDef.exports;
let exports: Type<any>[];

Loading…
Cancel
Save