What is the use of polyfills.ts file in Angular

前端 未结 2 1393
礼貌的吻别
礼貌的吻别 2021-02-04 23:38

polyfills.ts file is auto generated while creating an Angular application using Angular Cli. Can anyone explain me what is the use of polyfills.ts file in Angular application.

2条回答
  •  天命终不由人
    2021-02-05 00:28

    Polyfills in angular are few lines of code which make your application compatible for different browsers. The code we write is mostly in ES6(New Features: Overview and Comparison) and is not compatible with IE or firefox and needs some environment setups before being able to be viewed or used in these browsers.

    Polyfills.ts was provided by angular to help you do away with need to specifically setup everything.

    From Docs

    Angular is built on the latest standards of the web platform. Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers.

    Read more here

提交回复
热议问题