Angular 2 - script5007: unable to get "apply" property from undefined or null reference

I created a simple project:

ng new my-app cd my-app ng serve 

Chrome and Firefox are fine, but when I run in IE 11 it returns this error: SCRIPT5007

enter image description here enter image description here

Can someone help me?

+6
source share
2 answers

I found that this problem can be reproduced in Angular 2.4, and you can fix it using Angular 2.2.x or 2.3.x. I registered a problem for the Angular team, here is the link: https://github.com/angular/angular/issues/14592

===================================================

This does not seem to be an angular problem, but an Angular cli. See https://github.com/angular/angular-cli/issues/4862

As an answer to the question about angular-cli, IE11 polyfields are commented out by default, you need to include policies in src \ polyfills.ts.

+3
source

This is a CLI message, not angular

In the new version of angular - CLI src \ polyfills.ts are commented out by default.

  • open src/polyfills.ts
  • refuse comments on these files and execute

BROWSER INDICATORS

/ ** For IE9, IE10, and IE11 all of the following polyfields are required. ** /

Here is the list of files:

  import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/function'; import 'core-js/es6/parse-int'; import 'core-js/es6/parse-float'; import 'core-js/es6/number'; import 'core-js/es6/math'; import 'core-js/es6/string'; import 'core-js/es6/date'; import 'core-js/es6/array'; import 'core-js/es6/regexp'; import 'core-js/es6/map'; import 'core-js/es6/set'; 
+17
source

Source: https://habr.com/ru/post/1015027/


All Articles