2015年7月18日 星期六

difference fo '.resoure' and '.route' in route

import Ember from 'ember';


var Router = Ember.Router.extend({

});

Router.map(function() {
    this.resource('posts', function() {
        this.route('new');
        this.route('edit');
        this.route('post',{'path':'/:postId'});
    });
});
export default Router;
 
ember will read template from posts/new

if you use resource will read template from new

沒有留言:

張貼留言