Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get zone-free window methods with Zone.js

Can zone-free window methods (setTimeout, etc) be accessed somehow with loaded Zone.js ? Does Zone.js expose the original unpatched methods?

The example of possible use case is Angular 2 app that has some problems with Angular 2 Material data binding and needs to call un-zoned setTimeout as temporary but instant workaround - before the issue will be fixed properly.

like image 988
Estus Flask Avatar asked Jul 08 '16 12:07

Estus Flask


1 Answers

yes, basically the native method can be access by

target[Zone['__symbol__'](methodName)]

or target['zone_symbol'methodName]

such as

window['__zone_symbol__setTimeout']

and you can access NativePromise by

window['__zone_symbol__Promise']

I will make a list later.

like image 77
jiali passion Avatar answered Sep 20 '22 01:09

jiali passion