This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(webcomponents): fix #782, fix conflicts with shadydom of webcompo…
…nents (#784) * fix(webcomponents): fix #782, fix conflicts with shadydom of webcomponents * add doc * use new private api method
- Loading branch information
1 parent
82d4133
commit 245f8e9
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @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 | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(factory()); | ||
}(this, (function () { 'use strict'; | ||
|
||
/** | ||
* @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 | ||
*/ | ||
Zone.__load_patch('shadydom', function (global, Zone, api) { | ||
var patchEventTargetMethods = Zone[Zone.__symbol__('patchEventTargetMethods')]; | ||
// https://github.com/angular/zone.js/issues/782 | ||
// in web components, shadydom will patch addEventListener/removeEventListener of | ||
// Node.prototype and WindowPrototype, this will have conflict with zone.js | ||
// so zone.js need to patch them again. | ||
var windowPrototype = Object.getPrototypeOf(window); | ||
if (windowPrototype && windowPrototype.hasOwnProperty('addEventListener')) { | ||
windowPrototype[Zone.__symbol__('addEventListener')] = null; | ||
windowPrototype[Zone.__symbol__('removeEventListener')] = null; | ||
patchEventTargetMethods(windowPrototype); | ||
} | ||
if (Node.prototype.hasOwnProperty('addEventListener')) { | ||
Node.prototype[Zone.__symbol__('addEventListener')] = null; | ||
Node.prototype[Zone.__symbol__('removeEventListener')] = null; | ||
patchEventTargetMethods(Node.prototype); | ||
} | ||
}); | ||
|
||
}))); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @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 | ||
*/ | ||
Zone.__load_patch('shadydom', (global: any, Zone: ZoneType, api: _ZonePrivate) => { | ||
// https://github.com/angular/zone.js/issues/782 | ||
// in web components, shadydom will patch addEventListener/removeEventListener of | ||
// Node.prototype and WindowPrototype, this will have conflict with zone.js | ||
// so zone.js need to patch them again. | ||
const windowPrototype = Object.getPrototypeOf(window); | ||
if (windowPrototype && windowPrototype.hasOwnProperty('addEventListener')) { | ||
(windowPrototype as any)[Zone.__symbol__('addEventListener')] = null; | ||
(windowPrototype as any)[Zone.__symbol__('removeEventListener')] = null; | ||
api.patchEventTargetMethods(windowPrototype); | ||
} | ||
if (Node.prototype.hasOwnProperty('addEventListener')) { | ||
(Node.prototype as any)[Zone.__symbol__('addEventListener')] = null; | ||
(Node.prototype as any)[Zone.__symbol__('removeEventListener')] = null; | ||
api.patchEventTargetMethods(Node.prototype); | ||
} | ||
}); |