MCPcopy Index your code
hub / github.com/angular/angular / patchCustomElements

Function patchCustomElements

packages/zone.js/lib/browser/custom-elements.ts:9–28  ·  view source on GitHub ↗
(_global: any, api: _ZonePrivate)

Source from the content-addressed store, hash-verified

7 */
8
9export function patchCustomElements(_global: any, api: _ZonePrivate) {
10 const {isBrowser, isMix} = api.getGlobalObjects()!;
11 if ((!isBrowser && !isMix) || !_global['customElements'] || !('customElements' in _global)) {
12 return;
13 }
14
15 // https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-lifecycle-callbacks
16 const callbacks = [
17 'connectedCallback',
18 'disconnectedCallback',
19 'adoptedCallback',
20 'attributeChangedCallback',
21 'formAssociatedCallback',
22 'formDisabledCallback',
23 'formResetCallback',
24 'formStateRestoreCallback',
25 ];
26
27 api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks);
28}

Callers 1

patchBrowserFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…