-
Notifications
You must be signed in to change notification settings - Fork 407
feat(onProperty): fix #875, can disable patch specified onProperties #877
Conversation
export function propertyDescriptorPatch(api: _ZonePrivate, _global: any) { | ||
if (isNode && !isMix) { | ||
return; | ||
} | ||
|
||
const supportsWebSocket = typeof WebSocket !== 'undefined'; | ||
if (canPatchViaPropertyDescriptor()) { | ||
const ignoreProperties: IgnoreProperty[] = _global.__Zone_ignore_on_properties; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we turn this into our own module so that it is consistent with the rest of the system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhevery , currently propertyDescriptorPatch
is only be called from here, it is already in our module system.
Zone.__load_patch('on_property', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
propertyDescriptorPatch(api, global);
propertyPatch();
registerElementPatch(global);
});
and the _global
is also from our own module parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what is the point of having this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, now I understand. ... :-)
fix #875.
can disable patch specified onProperties,for example,
if you want to disable
window.onmessage
andHTMLElement.prototype.onclick
from zone.js patching,you can do like this.