File

core/plugins/plugins-resolve.service.ts

Index

Methods

Constructor

constructor(tabs: TabsService, navigator: NavigatorService, action: ActionService, actionBar: ActionBarService, breadcrumb: BreadcrumbService, dynamicComponent: DynamicComponentService, search: SearchService, c8yRouter: RouterService, docs: DocsService, wizard: WizardService, stepper: StepperService, injector: EnvironmentInjector, translateService: TranslateService, fetchClient: FetchClient, appState: AppStateService)
Parameters :
Name Type Optional
tabs TabsService No
navigator NavigatorService No
action ActionService No
actionBar ActionBarService No
breadcrumb BreadcrumbService No
dynamicComponent DynamicComponentService No
search SearchService No
c8yRouter RouterService No
docs DocsService No
wizard WizardService No
stepper StepperService No
injector EnvironmentInjector No
translateService TranslateService No
fetchClient FetchClient No
appState AppStateService No

Methods

clearURLRemotesCache
clearURLRemotesCache()

Clears URL remotes cache.

Returns : void
loadModule
loadModule(remoteNgModule: NgModuleRef<> | Type<>)
Parameters :
Name Type Optional
remoteNgModule NgModuleRef<> | Type<> No
Returns : NgModuleRef<unknown>
loadModulesDynamically
loadModulesDynamically(remoteNgModules: NgModuleRef<>[] | Type<>[])

Loads modules and handles hooking correctly.

Parameters :
Name Type Optional Description
remoteNgModules NgModuleRef<>[] | Type<>[] No

The modules to load.

Returns : void
Async loadRemotes
loadRemotes(remotes: ApplicationRemotePlugins)

Loads a list of remotes so that a particular application can use them. The request is made to the following address: /apps//remoteEntry.js

Parameters :
Name Type Optional Description
remotes ApplicationRemotePlugins No

List of remotes to be loaded.

Returns : unknown

Returns the list of loaded modules from remotes.

loadUrlRemotes
loadUrlRemotes()

Retrieves the remotes list from the URL.

Returns : ApplicationRemotePlugins

Returns the list of remotes.

markPluginsAsLoaded
markPluginsAsLoaded()
Returns : void
mergeMFRemotes
mergeMFRemotes(mfRemotes: ApplicationRemotePlugins[])

Takes a list of remotes and turns it into an object containing union of corresponding remotes.

Example

const remotesA:ApplicationRemotePlugins = { contextPathA: ['moduleA', 'moduleB'] };
const remotesB:ApplicationRemotePlugins = { contextPathA: ['moduleA'], contextPathB: ['moduleZ'] };
const mergedRemotes:ApplicationRemotePlugins = mergeMFRemotes([remotesA, remotesB]);
// Result
{
 contextPathA: ['moduleA', 'moduleB'],
 contextPathB: ['moduleZ']
}
Parameters :
Name Type Optional Description
mfRemotes ApplicationRemotePlugins[] No

List of the remotes.

Returns : ApplicationRemotePlugins

Returns object with merged remotes.

Example

const remotesA:ApplicationRemotePlugins = { contextPathA: ['moduleA', 'moduleB'] };
const remotesB:ApplicationRemotePlugins = { contextPathA: ['moduleA'], contextPathB: ['moduleZ'] };
const mergedRemotes:ApplicationRemotePlugins = mergeMFRemotes([remotesA, remotesB]);
// Result
{
contextPathA: ['moduleA', 'moduleB'],
contextPathB: ['moduleZ']
}
refreshHooks
refreshHooks(allHooks)

Will refresh all current registered hooks refresh such hooks, that possible has a remote plugin assigned.

Parameters :
Name Optional Default value Description
allHooks No false

If set to true, all hooks will be refreshed. Defaults to false, which will only refresh such hooks, that possible has a remote plugin assigned.

Returns : void
resolveRemotePlugins
resolveRemotePlugins(remoteModules: Array)

Loads plugins by resolving the remote NgModules and injecting it. Also attaching the hooks onto the root injector.

Parameters :
Name Type Optional Description
remoteModules Array<literal type> No

The remote plugins to load as factory name mapping array.

Returns : void

results matching ""

    No results matching ""