1
하위 템플릿의 데이터에 어떻게 액세스합니까?하위 템플릿에 데이터 전달
App.Router.map(function() {
this.resource("users", function(){
this.route('new');
});
this.resource("user", {path: '/users/:user_id'}, function(){
this.route('edit');
});
});
경로 :
App.UsersIndexRoute = Ember.Route.extend({
model: function() {
return App.User.find();
}
});
단일 사용자 템플릿 :
<script type="text/x-handlebars" data-template-name="user">
<h2>{{name_full}} is the username on the resource template</h2>
{{ outlet }}
</script>
단일 사용자 인덱스 템플릿 :
<script type="text/x-handlebars" data-template-name="user/index">
<h2>{{name_full}} is the username on the index page.</h2>
{{#linkTo users}}Back to All Users{{/linkTo}}
</script>
예를 들어
그녀는 내 라우터의
단일 사용자 템플릿이 사용자 개체에 액세스하는 방법을 이해하지만 하위 경로에 어떻게 액세스 할 수 있습니까?
나는 Ember Router Guides을 방문했지만, 여전히 나에게 명확하지 않습니다.
의미가 있습니다. 고맙습니다. – user1168427