相关疑难解决方法(0)

Angular2 IE11无法获取未定义或空引用的属性"apply"

将angular2包升级到以下版本后,出现以下错误:

  • @ angular/common":"^ 2.3.1
  • @ angular/compiler":"^ 2.3.1
  • @ angular/core":"^ 2.3.1
  • @ angular/forms":"^ 2.3.1
  • @ angular/http":"^ 2.3.1
  • @ angular/platform-b​​rowser":"^ 2.3.1"
  • @ angular/platform-b​​rowser-dynamic":"^ 2.3.1
  • @ angular/platform-server":"^ 2.3.1
  • @ angular/router":"^ 3.3.1

错误:Unable to get property 'apply' of undefined or null reference

在此输入图像描述

我只在IE11中收到此错误,在Chrome中它运行正常.

我做了一些挖掘,导致错误的行在angular/common模块中:

function combine(options) {
  return (_a = ((Object))).assign.apply(_a, [{}].concat(options));
  var _a;
}
Run Code Online (Sandbox Code Playgroud)

打字稿文件:

@ angular/common/src/pipes/intl.ts第175行

function combine(options: Intl.DateTimeFormatOptions[]): Intl.DateTimeFormatOptions {
  return (<any>Object).assign({}, ...options);
}
Run Code Online (Sandbox Code Playgroud)

调用该combine函数的代码是 @ angular/common/src/pipes/intl.ts第48行:

'yMMMdjms': datePartGetterFactory(combine([


UPDATE

似乎实际的错误是.assignIE11中没有实现该方法

javascript typescript angular

67
推荐指数
7
解决办法
3万
查看次数

我使用VS模板创建的Angular 2 ASP.NET Core应用程序中的Polyfills.ts是否缺失?

我是Angular开发的新手,我正在使用Visual Studio 2017 Professional模板开始使用ASP.Net Core创建一个Angular 2应用程序: 在此输入图像描述

我的问题是该应用程序无法在Internet Explorer 11上运行并且搜索我发现我必须取消注释polyfills文件中的内容.

我已经找到它,D:\MyProjects\NetCore\AngularWebApplication\AngularWebApplication\node_modules\graceful-fs\polyfills.js但它没有预期的相同内容(就像在这个SO答案中显示的那样).

使用VS模板是一个好主意,或者我可以使用Empty模板并添加Angular应用程序吗?

asp.net-core angular

4
推荐指数
2
解决办法
1999
查看次数

标签 统计

angular ×2

asp.net-core ×1

javascript ×1

typescript ×1