Skip to content

Commit ffec4fb

Browse files
JiaLiPassionkyliau
authored andcommitted
fix(@schematics/angular): import zone related flags in other files
fix #12886
1 parent 1af7c46 commit ffec4fb

File tree

1 file changed

+19
-10
lines changed
  • packages/schematics/angular/application/files/src

1 file changed

+19
-10
lines changed

packages/schematics/angular/application/files/src/polyfills.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,27 @@
5757
/**
5858
* By default, zone.js will patch all possible macroTask and DomEvents
5959
* user can disable parts of macroTask/DomEvents patch by setting following flags
60+
* because those flags need to be set before `zone.js` being loaded, and webpack
61+
* will put import in the top of bundle, so user need to create a separate file
62+
* in this directory (for example: zone-flags.ts), and put the following flags
63+
* into that file, and then add the following code before importing zone.js.
64+
* import './zone-flags.ts';
65+
*
66+
* The flags allowed in zone-flags.ts are listed here.
67+
*
68+
* The following flags will work for all browsers.
69+
*
70+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
71+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
72+
* (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
73+
*
74+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
75+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
76+
*
77+
* (window as any).__Zone_enable_cross_context_check = true;
78+
*
6079
*/
6180

62-
// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
63-
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
64-
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
65-
66-
/*
67-
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
68-
* with the following flag, it will bypass `zone.js` patch for IE/Edge
69-
*/
70-
// (window as any).__Zone_enable_cross_context_check = true;
71-
7281
/***************************************************************************************************
7382
* Zone JS is required by default for Angular itself.
7483
*/

0 commit comments

Comments
 (0)