Ember笔记

ember经常使用的方法(官方文档的翻译而已):javascript

 

1.modelFor

在路由层级中,返回父路径路由解析的model,具体例子以下:java

App.Router.map(function() {
    this.route('post', { path: '/post/:post_id' }, function() { this.route('comments', { resetNamespace: true }); }); }); App.CommentsRoute = Ember.Route.extend({ afterModel: function() { this.set('post', this.modelFor('post')); } });
相关文章
相关标签/搜索