angular-cli: IE9 TypeError 'apply'

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.1 node: 7.9.0 os: win32 x64 @angular/animations: 4.1.0 @angular/common: 4.1.0 @angular/compiler: 4.1.0 @angular/core: 4.1.0 @angular/forms: 4.1.0 @angular/http: 4.1.0 @angular/platform-browser: 4.1.0 @angular/platform-browser-dynamic: 4.1.0 @angular/router: 4.1.0 @angular/cli: 1.0.1 @angular/compiler-cli: 4.1.0

Repro steps.

ng build --aot --prod tested on a real webserver

The log given by the failure.

In console of ie9 : TypeError: Object doesn’t support property or method ‘apply’

Desired functionality.

Works on ie9

Mention any other details that might be useful.

I tested with polyfills.ts ( core-js/es6 + classlist ). Also tested with shim.min.js, Typed Array, Blob, FormData from https://angular.io/docs/ts/latest/guide/browser-support.html

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 30 (3 by maintainers)

Commits related to this issue

Most upvoted comments

keyword: Korean, resolved, zone.js, 0.8.4

저의 경우 IE9에서 subscribe를 호출할 때마다 TypeError: 'apply’가 발생 했습니다.

해당 문제를 zone.js 버전을 변경하여 해결을 했습니다.

result

// old package.json
 "dependencies": {
  ...
  "zone.js": "0.8.12"
  ...
 }
// change package.json
 "dependencies": {
  ...
  "zone.js": "^0.8.4"
  ...
 }

이렇게 변경하고난 후 부터 정상 작동하였습니다.

Hey Guys,

Just fixed this stuff for myself and want to update you with my experience as it can be very helpful…

To make Angular 6.0.0 run for IE9:

  • In /src/polyfills.ts you should uncomment (and install): import 'core-js/es6/reflect'; import 'web-animations-js'; // Runnpm install --save web-animations-js. Note uncommenting // import 'web-animations-js'; caused for me strange errors, but it is unneeded if you are not using angular animations
  • Set useHash to true for your route: imports: [RouterModule.forRoot(routes, {useHash: true})],
  • Also due to console is undefined in IE9 by default (application was broken untill you opened dev tools to enable console) and thanks too @idasbiste comment here: Install https://github.com/paulmillr/console-polyfill and import import 'console-polyfill'; to polyfills.ts