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

Method addElement

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

* Add an element 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-element.BaseElement} implementationClass * @param {?string|undefi

(name, implementationClass, css)

Source from the content-addressed store, hash-verified

334 * @restricted
335 */
336 addElement(name, implementationClass, css) {
337 const holder = this.getCurrentExtensionHolder_(name);
338 holder.extension.elements[name] = {implementationClass, css};
339 this.addDocFactory((ampdoc) => {
340 this.installElement_(ampdoc, name, implementationClass, css);
341 });
342 }
343
344 /**
345 * Add a template type to the extension currently being registered. This is a

Callers

nothing calls this directly

Calls 3

addDocFactoryMethod · 0.95
installElement_Method · 0.95

Tested by

no test coverage detected