polyfills.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* eslint-disable import/no-unassigned-import */
  17. /**
  18. * This file includes polyfills needed by Angular and is loaded before the app.
  19. * You can add your own extra polyfills to this file.
  20. *
  21. * This file is divided into 2 sections:
  22. * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
  23. * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
  24. * file.
  25. *
  26. * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
  27. * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
  28. * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
  29. *
  30. * Learn more in https://angular.io/guide/browser-support
  31. */
  32. /***************************************************************************************************
  33. * BROWSER POLYFILLS
  34. */
  35. /**
  36. * By default, zone.js will patch all possible macroTask and DomEvents
  37. * user can disable parts of macroTask/DomEvents patch by setting following flags
  38. * because those flags need to be set before `zone.js` being loaded, and webpack
  39. * will put import in the top of bundle, so user need to create a separate file
  40. * in this directory (for example: zone-flags.ts), and put the following flags
  41. * into that file, and then add the following code before importing zone.js.
  42. * import './zone-flags';
  43. *
  44. * The flags allowed in zone-flags.ts are listed here.
  45. *
  46. * The following flags will work for all browsers.
  47. *
  48. * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
  49. * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
  50. * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
  51. *
  52. * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
  53. * with the following flag, it will bypass `zone.js` patch for IE/Edge
  54. *
  55. * (window as any).__Zone_enable_cross_context_check = true;
  56. *
  57. */
  58. /***************************************************************************************************
  59. * Zone JS is required by default for Angular itself.
  60. */
  61. import 'zone.js'; // Included with Angular CLI.
  62. /***************************************************************************************************
  63. * APPLICATION IMPORTS
  64. */