* Loads component from module with context * @param moduleName the module name * @param exports the context of the component to be loaded
(pathOrOptions: string | LoadOptions, context?: any)
| 122 | * @param exports the context of the component to be loaded |
| 123 | */ |
| 124 | static load(pathOrOptions: string | LoadOptions, context?: any): View { |
| 125 | let componentModule: ComponentModule; |
| 126 | if (typeof pathOrOptions === 'string') { |
| 127 | const moduleName = sanitizeModuleName(pathOrOptions); |
| 128 | componentModule = loadInternal(moduleName, context); |
| 129 | } else { |
| 130 | componentModule = loadCustomComponent(pathOrOptions.path, pathOrOptions.name, pathOrOptions.attributes, pathOrOptions.exports, pathOrOptions.page, true); |
| 131 | } |
| 132 | |
| 133 | return componentModule && componentModule.component; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Creates an array of KeyedTemplates from string |
no test coverage detected