我想知道使用哪一个来构建模拟Web服务来测试Angular程序?
我有一段在 Angular 5 中运行良好的代码,但我正在尝试更新到 Angular 8:
this.awsService.getProfiles().subscribe(profiles => {
this.profiles = profiles;
if (this.profiles.length > 0 && this.profiles.indexOf(this.currentProfile) == -1) {
this.currentProfile = this.profiles[0];
localStorage.setItem('profile', this.currentProfile);
}
}, err => {
this.profiles = [];
})
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
ERROR in app/app.component.ts:85:9 - error TS2696: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
Type 'Object' is missing the following properties from type 'string[]': length, pop, push, concat, and 26 more.
85 this.profiles …Run Code Online (Sandbox Code Playgroud)