File

core/plugins/plugins-resolve.service.ts

Index

Properties
Methods

Constructor

constructor(translateService: TranslateService, fetchClient: FetchClient, appState: AppStateService, injector: EnvironmentInjector, optionsService: OptionsService)
Parameters :
Name Type Optional
translateService TranslateService No
fetchClient FetchClient No
appState AppStateService No
injector EnvironmentInjector No
optionsService OptionsService No

Methods

clearURLRemotesCache
clearURLRemotesCache()

Clears URL remotes cache.

Returns : void
loadModule
loadModule(remoteNgModule: NgModuleRef | Type)
Type parameters :
  • T
Parameters :
Name Type Optional
remoteNgModule NgModuleRef<T> | Type<T> No
Returns : NgModuleRef<T>
loadModulesDynamically
loadModulesDynamically(remoteModules: Array)

Loads modules and handles hooking correctly.

Parameters :
Name Type Optional
remoteModules Array<literal type> No
Returns : void
loadProviders
loadProviders(providers: Provider[], name: string)
Parameters :
Name Type Optional
providers Provider[] No
name string No
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 the list of remotes.

markPluginsAsLoaded
markPluginsAsLoaded()
Returns : void
mergeMFRemotes
Use the static function mergeRemotes as this is a pure function. **Example** ```typescript 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'] } ```
mergeMFRemotes(mfRemotes: ApplicationRemotePlugins[])

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

Example

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 object with merged remotes.

Static mergeRemotes
mergeRemotes(remotes: ApplicationRemotePlugins[])

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

Example

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

List of the remotes.

Returns object with merged remotes.

Example

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

Will refresh all current registered hooks.

Returns : void
Static removeRemotes
removeRemotes(remotesToRemoveFrom: ApplicationRemotePlugins, remotesToRemove?: ApplicationRemotePlugins)
Parameters :
Name Type Optional
remotesToRemoveFrom ApplicationRemotePlugins No
remotesToRemove ApplicationRemotePlugins Yes
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

Properties

allPluginsLoaded$
Type : Observable<boolean>
injectors$
Type : Observable<EnvironmentInjector | Injector>

Emits all injectors of already loaded plugins on subscription.

pluginDetails$
Type : Observable<literal type>

Emits all plugin details of already loaded plugins on subscription.

refresh$
Type : Observable<void>

Emits once remotePlugins have been resolved.

results matching ""

    No results matching ""