Angular中polyfills.ts文件的用途是什么 [英] What is the use of polyfills.ts file in Angular

查看:890
本文介绍了Angular中polyfills.ts文件的用途是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

polyfills.ts文件. 谁能解释一下Angular应用程序中polyfills.ts文件的用途.

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.

推荐答案

Polyfills 的几行代码使您的应用程序与不同的浏览器兼容.我们编写的代码主要在ES6(新功能:概述和比较)中,与IE或firefox不兼容,并且需要一些环境设置才能在这些浏览器中查看或使用.

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 由angular提供,可帮助您消除专门设置所有内容的需要.

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

来自 Docs

From Docs

Angular建立在Web平台的最新标准之上. 针对如此广泛的浏览器具有挑战性,因为它们确实 不支持现代浏览器的所有功能.

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.

了解更多信息 here

这篇关于Angular中polyfills.ts文件的用途是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆