register-element.ts 627 B

12345678910111213141516171819
  1. /**
  2. * @license
  3. * Copyright Google Inc. All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. export function registerElementPatch(_global: any, api: _ZonePrivate) {
  9. const {isBrowser, isMix} = api.getGlobalObjects()!;
  10. if ((!isBrowser && !isMix) || !('registerElement' in (<any>_global).document)) {
  11. return;
  12. }
  13. const callbacks =
  14. ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
  15. api.patchCallbacks(api, document, 'Document', 'registerElement', callbacks);
  16. }