2017-01-20 22 views
0

我的網址json是@_____,但我不能稱之爲。如何得到它? 感謝您的回答。如何調用JSON數據「@」

" RESULT":{ 
      "FACET":[{ "@NAME" : "creator", "@COUNT" : "20", 
      "FACET_VALUES":[ 
      { 
       "@KEY":"Book Company1", 
       "@VALUE":"13"}, 
      { 
       "@KEY":"Book Company1์", 
       "@VALUE":"10"} 
      ] 

this.http.get("my_url") 
      .subscribe(data =>{ 
        this.items=data.json().RESULT.FACET.FACET_VALUES; 
      },error=>{ 
       console.log(error); 
      }); 

<ion-list> 
    <ion-item *ngFor="let item of items" (click)="itemClicked($event,item)"> 
     <h2>{{item.[email protected]}}</h2> /////this error 
     <p>{{[email protected]}}</p> /////this error 
     <button ion-button clear item-right (click)="buttonClick($event)">View</button> 
    </ion-item> 
    </ion-list> 

回答

0

通常在JavaScript中,您將使用item["@KEY"]。但我不知道這是否適用於這個框架的模板語言。

+0

非常感謝!我能做到! – fongfuse

相關問題