MCPcopy
hub / github.com/angular-ui/ui-router / fromComponentProvider

Method fromComponentProvider

src/templateFactory.ts:142–147  ·  view source on GitHub ↗

* Creates a component's template by invoking an injectable provider function. * * @param provider Function to invoke via `locals` * @param {Function} injectFn a function used to invoke the template provider * @return {string} The template html as a string: "<component-name input1='::$res

(provider: IInjectable, params: any, context: ResolveContext)

Source from the content-addressed store, hash-verified

140 * @return {string} The template html as a string: "<component-name input1='::$resolve.foo'></component-name>".
141 */
142 fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext) {
143 const deps = services.$injector.annotate(provider);
144 const providerFn = isArray(provider) ? tail(<any[]>provider) : provider;
145 const resolvable = new Resolvable('', <Function>providerFn, deps);
146 return resolvable.get(context);
147 }
148
149 /**
150 * Creates a template from a component's name

Callers 1

fromConfigMethod · 0.95

Calls 1

isArrayFunction · 0.85

Tested by

no test coverage detected