MCPcopy Index your code
hub / github.com/ampproject/amphtml / getLoaderServicePromise

Function getLoaderServicePromise

src/service/loader-element.js:10–14  ·  view source on GitHub ↗

* Gets a Promise for the LoaderService, initiating a request to download the * code. * @param {!./ampdoc-impl.AmpDoc} ampDoc * @param {!Element} element * @return {!Promise<!../../extensions/amp-loader/0.1/amp-loader.LoaderService>}

(ampDoc, element)

Source from the content-addressed store, hash-verified

8 * @return {!Promise<!../../extensions/amp-loader/0.1/amp-loader.LoaderService>}
9 */
10function getLoaderServicePromise(ampDoc, element) {
11 return Services.extensionsFor(ampDoc.win)
12 .installExtensionForDoc(ampDoc, 'amp-loader')
13 .then(() => Services.loaderServiceForDoc(element));
14}
15
16/**
17 * Creates a default "loading indicator" element based on the new design.

Callers 1

createLoaderElementFunction · 0.85

Calls 2

thenMethod · 0.45

Tested by

no test coverage detected