2017-06-08 27 views
-1

enter image description here我使用的離子與解析,我試圖從res.results我不斷收到未定義

訪問的孩子我仍然得到未定義錯誤

unfollow(){ 
     this.url ='https://meet-up-zionnite.c9users.io/app1/classes/friendslist'; 
    this.http.get(this.url, {headers : this.headers}).map(res => res.json()).subscribe(res =>{ 
    this.localstorage.set('friendslist_db_detail',res); 
    console.log(res.results.my_id); 
    if(res.results == this.my_id){ 
    console.log('hey over here'); 
    }else{ 
    console.log("Not Match"); 
    } 
    }); 
    } 

這是我需要訪問的內容:

1)的ObjectId

2)添加my_id

3)F_ID

回答

0

哇,我收到的幫助我的網上導師之一,它解決了它 這裏是已經失蹤

console.log(res.results[0]['my_id']); 
+0

很高興聽到您解答了它:)請將答案標記爲已接受,以便我們可以結束問題 – sebaferreras

+0

請問,我可以在哪裏點擊以使答案接受 – user3728868

+0

請看看[this](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) – sebaferreras

相關問題