angular
angular copied to clipboard
fix(zone.js): allow enabling default `beforeunload` handling
Prior to this commit, when zone.js was included, it wasn't possible to handle beforeunload
events correctly if event handlers returned strings to prompt the user.
With this change, we introduce a global configuration flag, __zone_symbol__enable_beforeunload
, to allow consumers to enable the default beforeunload
handling behavior.
This flag is necessary to prevent any breaking changes resulting from this modification. The previous attempt to fix it caused a large number of failures in G3. Hence, we're hiding that fix behind the configuration flag.
Closes #47579 Closes #52256