Javascript 由于 TypeScript,在旧浏览器中使用 Angular 2?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30669753/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using Angular 2 with older browsers thanks to TypeScript?
提问by bkbarton
Since the Angular 2 team is using Typescript for it's build, would it be a feasible assumption that they could compile a version of Angular 2 that would work on older browsers?
由于 Angular 2 团队正在使用 Typescript 进行构建,是否可以假设他们可以编译适用于旧浏览器的 Angular 2 版本?
采纳答案by Noel
Edit 2:
编辑2:
It appears the Angular team has decided to support some non evergreen browsers. Per Brad Green (of the Angular team): What browsers versions will Angular 2 support? There's a new build widget with some hints on https://github.com/angular/angular
看来 Angular 团队已经决定支持一些非常绿浏览器。根据 Brad Green(Angular 团队的):What browsers versions will Angular 2 support? There's a new build widget with some hints on https://github.com/angular/angular
Currently, the Readme shows IE9 and up.
目前,自述文件显示 IE9 及更高版本。
Angular 2 will onlysupport modern browsers:
Angular 2 将只支持现代浏览器:
Modern browsers means the set of browsers known as ‘evergreen' or always automatically updated to the latest version. Building for these browsers let us drop many hacks and workarounds that make AngularJS harder to use and develop on than it needs to be.
The set currently includes Chrome, FireFox, Opera, Safari, and IE10/11. On mobile, we'll support something close to the list of Chrome on Android, iOS 6+, Windows Phone 8+ and Firefox mobile. We're looking into supporting older versions of Android, but the jury is still out.
现代浏览器是指称为“常青”或始终自动更新到最新版本的浏览器集。为这些浏览器构建让我们放弃了许多使 AngularJS 更难使用和开发的技巧和变通方法。
该套装目前包括 Chrome、FireFox、Opera、Safari 和 IE10/11。在移动设备上,我们将支持与 Android、iOS 6+、Windows Phone 8+ 和 Firefox 移动设备上的 Chrome 列表相近的功能。我们正在考虑支持旧版本的 Android,但尚无定论。
http://angularjs.blogspot.com/2014/03/angular-20.html
http://angularjs.blogspot.com/2014/03/angular-20.html
Edit:To address your comment, no Typescript is not the limiting factor for Angular 2's lack of support for non-modern browsers (nor going to provide any magical support). Typescript can transpile to ES3, so if your target browser supports ES3, you can use Typescript. Conversely, Angular 2 will gain nothing wrt supporting legacy browsers by using TypeScript.
编辑:为了解决您的评论,没有 Typescript 不是 Angular 2 缺乏对非现代浏览器的支持(也不会提供任何神奇的支持)的限制因素。Typescript 可以转译为 ES3,所以如果你的目标浏览器支持 ES3,你可以使用 Typescript。相反,Angular 2 将无法通过使用 TypeScript 来支持旧版浏览器。

