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

Method addTemplate

src/service/extensions-impl.js:352–356  ·  view source on GitHub ↗

* Add a template type to the extension currently being registered. This is a * restricted method and it's allowed to be called only during the overall * extension registration. * @param {string} name * @param {typeof ../base-template.BaseTemplate} implementationClass * @restricted

(name, implementationClass)

Source from the content-addressed store, hash-verified

350 * @restricted
351 */
352 addTemplate(name, implementationClass) {
353 this.addDocFactory((ampdoc) => {
354 registerExtendedTemplateForDoc(ampdoc, name, implementationClass);
355 });
356 }
357
358 /**
359 * Installs the specified element implementation in the ampdoc.

Callers 1

test-extensions.jsFile · 0.80

Calls 2

addDocFactoryMethod · 0.95

Tested by

no test coverage detected