2
현재 경로의 모델에 액세스해야하는 구성 요소를 쓰고 있습니다. 구성 요소의 템플릿에 내가 좋아하는 일을하고 싶습니다 :Ember 구성 요소에서 현재 경로 모델 가져 오기
{{#each color in model}}
...
{{/each}}
내가 다른 모델
I가 구성 요소 내에서 현재 경로의 모델에 액세스 할 수있는 방법을으로, 다른 경로에서이 구성 요소를 사용합니까?
Ember.Component.extend({
didInsertElement: function() {
console.log(this.get('controller') //this is not the route's controller
console.log(this.get('controller').get('model')); //undefined of course
}
});
너무 간단했습니다! 감사 –