我想知道使用哪一个来构建模拟Web服务来测试Angular程序?
我已经将应用程序从Angular 4.2升级到5,但是出现了这个错误:
unhandled exception occurred while processing the request更具体地说:
NodeInvocationException:没有PlatformRef的提供者!错误:没有PlatformRef的提供程序!at injectionError(e:\ myapp\ClientApp\dist\vendor.js:12066:90)
该应用程序还使用webpack和ASP.NET Core.
我安装了node v9.1,和typescript 2.6.1.
我也package.json用命令更新了:
npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest
Run Code Online (Sandbox Code Playgroud)
然后,运行以下内容:
npm install --save-dev @ngtools/webpack@latest
Run Code Online (Sandbox Code Playgroud)
我也用过HttpClient而不是Http:
import { HttpClient } from '@angular/common/http';
.....
getThings() {
return this.http.get('/api/things');
}
Run Code Online (Sandbox Code Playgroud)
如果我降级回Angular 4,该应用程序工作正常,我的思路中是否有任何错误的做法?
我正在使用jhipster开发一个 Spring-Boot+Angular 应用程序。但是,在我的项目中使用带有 angular 5.6.0 的primeng 5.6.0 时出现此错误:
[at-loader] ./src/main/webapp/app/primeng/data/datascroller/datascrollerdemo.module.ts:4:28 TS2307 中的错误:找不到模块“@angular/http”。
任何帮助将被approeciated 。