2019-05-31 11:56:07 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
export function registerElementPatch(_global: any, api: _ZonePrivate) {
|
2020-04-13 19:40:21 -04:00
|
|
|
const {isBrowser, isMix} = api.getGlobalObjects()!;
|
2019-05-31 11:56:07 -04:00
|
|
|
if ((!isBrowser && !isMix) || !('registerElement' in (<any>_global).document)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const callbacks =
|
|
|
|
['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
|
|
|
|
|
|
|
|
api.patchCallbacks(api, document, 'Document', 'registerElement', callbacks);
|
|
|
|
}
|