18

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?

3
  • 3
    I assume you are thinking that typescript compiles to ES5 so everything should just work? No. It is not about the ES version. There are features that Angular2 uses that are just not supported in older browsers. There maybe pollifills available for some of these features, but would perform poorly. Commented Jun 5, 2015 at 15:52
  • @Martin, I believe you may have answered my question. My thinking was set on the ES conversion and the thought that Typescript would automatically compile polyfilled code to insure support in older browsers. Apparently, this isn't an option. However, how is it that TypeScript boasts about being able to compile js down to ES3 without accounting for functionality that isn't available without polyfills? Commented Jun 5, 2015 at 16:25
  • I don't believe ES3 support fits into your question. Simple things like property accessors are not supported in ES3. That being said, they are not supported in ES5 on all non-evergreen browsers. They cannot be pollifilled as far as I know. Typescript can de-sugure into plain old ES5, but the IE8 will break. Commented Jun 5, 2015 at 16:33

1 Answer 1

15

Edit 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

Currently, the Readme shows IE9 and up.

Angular 2 will only support modern browsers:

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.

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.

Sign up to request clarification or add additional context in comments.

2 Comments

the question is more geared towards the abilities of TypeScript. I did read Angular's bold declarations in their blog when it was officially released. When word got around that Angular 2 was using TypeScript for it's build process, I was curious if it was possible in the future to compile the ng2 down to be compatible with older browsers running running <ES5.
I was at the AngularConnect conference this year where the team said they'll even support IE9 in Angular 2 It's not sure however for how long that support will be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.