第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

角度:找不到其他支持對(duì)象“ [對(duì)象對(duì)象]”

角度:找不到其他支持對(duì)象“ [對(duì)象對(duì)象]”

我按照本教程。在從api.github獲取用戶列表的方式中,我收到錯(cuò)誤消息:找不到其他支持對(duì)象“ [object Object]”我認(rèn)為它與 <ul> <li *ngFor = "#user of users"> {{user | json}} </li> </ul>在我的代碼中,因?yàn)樵诖酥皼]有任何錯(cuò)誤,并且不確定數(shù)據(jù)是否來(lái)自get請(qǐng)求,只是單擊并沒有給出任何錯(cuò)誤,這是到目前為止的代碼@Component({selector: 'router',pipes : [],template: `<div><form [ngFormModel] = "searchform">      <input type = 'text' [ngFormControl]= 'input1'/></form>     <button (click) = "getusers()">Submit</button></div><div><ul>    <li *ngFor = "#user of users">    {{user | json}}    </li></ul></div><router-outlet></router-outlet>`,directives: [FORM_DIRECTIVES]})export class router {searchform: ControlGroup;users: Array<Object>[];input1: AbstractControl;constructor(public http: Http, fb: FormBuilder) {    this.searchform = fb.group({        'input1': ['']    })    this.input1 = this.searchform.controls['input1']}getusers() {    this.http.get(`https://api.github.com/search/users?q=${this.input1.value}`)        .map(response => response.json())        .subscribe(        data => this.users = data,        error => console.log(error)        )}}bootstrap(router, [HTTP_PROVIDERS])
查看完整描述

3 回答

?
慕標(biāo)5832272

TA貢獻(xiàn)1966條經(jīng)驗(yàn) 獲得超4個(gè)贊

我在代碼中收到此錯(cuò)誤,因?yàn)槲覜]有運(yùn)行JSON.parse(result)。


所以我的結(jié)果是一個(gè)字符串而不是對(duì)象數(shù)組。


即我得到:


"[{},{}]" 

代替:


[{},{}]

import { Storage } from '@ionic/storage';

...

private static readonly SERVER = 'server';

...

getStorage(): Promise {

  return this.storage.get(LoginService.SERVER);

}

...

this.getStorage()

  .then((value) => {

     let servers: Server[] = JSON.parse(value) as Server[];

                   }

  );


查看完整回答
反對(duì) 回復(fù) 2019-10-12
?
MMTTMM

TA貢獻(xiàn)1869條經(jīng)驗(yàn) 獲得超4個(gè)贊

輸入屬性周圍缺少方括號(hào)可能會(huì)導(dǎo)致此錯(cuò)誤。例如:


Component Foo {

    @Input()

    bars: BarType[];

}

正確:


<app-foo [bars]="smth"></app-foo>


不正確(觸發(fā)錯(cuò)誤):


<app-foo bars="smth"></app-foo>



查看完整回答
反對(duì) 回復(fù) 2019-10-12
  • 3 回答
  • 0 關(guān)注
  • 583 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)