MCPcopy
hub / github.com/ampproject/amphtml / getServiceForDoc

Function getServiceForDoc

src/service-helpers.js:203–207  ·  view source on GitHub ↗
(elementOrAmpDoc, id)

Source from the content-addressed store, hash-verified

201 * @template T
202 */
203export function getServiceForDoc(elementOrAmpDoc, id) {
204 const ampdoc = getAmpdoc(elementOrAmpDoc);
205 const holder = getAmpdocServiceHolder(ampdoc);
206 return getServiceInternal(holder, id);
207}
208
209/**
210 * Returns a service for the given id and ampdoc (a per-ampdoc singleton).

Callers 15

test-extensions.jsFile · 0.90
test-ampdoc.jsFile · 0.90
test-service.jsFile · 0.90
test-runtime.jsFile · 0.90
attachFunction · 0.90
test-template.jsFile · 0.90
test-analytics.jsFile · 0.90
chunkServiceForDocFunction · 0.90
getObserverFunction · 0.90
originExperimentsForDocFunction · 0.90

Calls 3

getAmpdocFunction · 0.85
getAmpdocServiceHolderFunction · 0.85
getServiceInternalFunction · 0.85

Tested by

no test coverage detected