-1

我试图从 Angular2 迁移到 Angular4,但在 Angular4 中出现错误:

  • 零件:

    从'@angular/platform-b​​rowser/testing/src/browser_util'导入{ browserDetection};

    if (browserDetection.isWebkit && browserDetection.supportsNativeIntlApi && !browserDetection.isChromeDesktop && !browserDetection.isOldChrome) { return new Blob([new Uint8Array(array).buffer], {type: mimeString}); }

  • 控制台中的错误:

    找不到模块:错误:无法解析“/Users/ivan/blablabla/src/app/+client/client-profile/shared”中的“@angular/platform-b​​rowser/testing/src/browser_util”

当我运行“npm start”时出现错误。在Angular2中没有错误并且一切正常&如何解决这个问题?

4

1 回答 1

0

尝试在 app.module.ts 中导入角度包

import { NgModule, ApplicationRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

在 main.ts 中使用引用的包

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
于 2017-03-27T10:06:50.400 回答