I have an Angular 2 application (In an ASP.NET 5 environment) that is working when running in Chrome, when running in IE 11 I'm getting the following error message in the console
Error: SyntaxError: Syntax error
at ZoneDelegate.prototype.invoke (http://localhost:52801/lib/angular2-polyfills.js:347:14)
at Zone.prototype.run (http://localhost:52801/lib/angular2-polyfills.js:242:18)
at Anonymous function (http://localhost:52801/lib/angular2-polyfills.js:597:18)
From what I have read there are problems when running Angular 2 applications from IE 11, most of these problems can be resolved by including the various shim
and polyfills
files in the correct order. Here are my javascript files that I include
<script src="~/lib/es6-shim.js"></script>
<script src="~/lib/systemjs/dist/system-polyfills.js"></script>
<script src="~/lib/shims_for_ie.js"></script>
<script src="~/lib/angular2-polyfills.js"></script>
<script src="~/lib/systemjs/dist/system.js"></script>
<script src="~/lib/rx.js"></script>
<script src="~/lib/angular2.dev.js"></script>
<script src="~/lib/router.dev.js"></script>
and my system config
<script>
System.config({ packages: { app: { defaultExtension: 'js' } } });
System.import('app/boot')
.then(null, console.error.bind(console));
</script>
Is there anything else that I have to do to get the application to run in IE 11?
You can also work through my Setting up Angular 2 in an ASP.NET 5 environment article on Code Project and download the source files.
After a lot of research I finally managed to get Angular 2 working within an ASP.NET 5 environment.
First of all make sure that you at least have the following versions of the IDE and other software tools installed.
To successfully setup an Angular 2 application you would need the following files
[Project Root Folder]/typings.json containing
[Project Root Folder]/package.json containing
[Project Root Folder]/gulpfile.js containing
Remember to execute these gulp tasks that will move the Angular 2 dependencies to the [Project Root Folder]/wwwroot.
[Project Root Folder]/scripts/app.component.ts file containing
[Project Root Folder]/scripts/main.ts file containing
[Project Root Folder]/tsconfig.json file containing
[Project Root Folder]/wwwroot/systemjs.config.js file containing
[Project Root Folder]/wwwroot/index.html file containing