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

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

问题描述

polyfills.ts 文件是在使用 Angular Cli 创建 Angular 应用程序时自动生成的.谁能解释一下 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 在 angular 中是几行代码,使您的应用程序兼容不同的浏览器.我们编写的代码大多是 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.

来自文档

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.

阅读更多此处

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

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