2016-07-07 4 views
-2

나는 경로에 있습니다액세스

import Ember from 'ember'; 
export default Ember.Route.extend({ 
model(params) { 

    let city = params.city_name; 
    let cuc = this.store.query('city', { 
     linkname: city, 
    }); 


    let itm = this.store.query('product', { 
     uriName: params.item_name, 
    }); 

    let dictpage = { 
     currentCity: cuc, 
     currentProduct: itm, 

    }; 

    return dictpage; 
}, 

});

fot(let i in itm){ 
    console.log(i.id); 
} 

일을 해달라고 : 내가 거기에 쓸 때

나는 CUC에서 속성 카테고리 ID를 얻을 필요하지만. 그것을하는 방법?

이 항목은 좋은 항목에서 카테고리를 찾을 필요가 있습니다.

미리 답변 해 주셔서 감사합니다.

+0

'fot'은'for'이어야합니다. –

+0

예,하지만 오타입니다. 내가 그것을 시도 할 때, 나는 오류를 본다! –

+0

'itm'이란 어떤 오류가 있습니까? –

답변

0

나는 그것을한다! 이 코드는, 내가 무엇을 필요로하는지 :

this.store.query('product', { 
      uriName: params.item_name 
     }).then(function(items) { 
      items.forEach(function(item) { 
       console.log(item.get('categoryId')); 
      }); 
     });