Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Loads components/directives modules for given extension point. Once all the component modules are loaded, their
- * plugin definitions are returned mapped by concrete property from their definition.
- *
- * @param extensionPoint
- * @param mapBy The key to be used for their mapping in the result map. This key should be an existing property from
- * plugin definitions for that extension point.
- * @returns {Promise.<T>|Promise} A map that contains plugin definitions for loaded modules mapped by provided key.
- */
- loadComponentModules(extensionPoint, mapBy, filterFunc) {
- var promises = [];
- let definitions = this.getPluginDefinitions(extensionPoint, mapBy);
- if (_.isFunction(filterFunc)) {
- console.log('definitions: ' + definitions);
- definitions = filterBy(definitions, filterFunc);
- }
- Object.keys(definitions).forEach((definition) => {
- promises.push(this.executeImport(definitions[definition].module));
- });
- return this.promiseAdapter.all(promises).then(() => {
- return definitions;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement