2013-03-21 25 views

回答

1

你可以直接使用JQuery Ajax调用:

$.ajax({ 
    url: '/projects/' + project_id + '.json', 
    type: 'GET', 
    success: function(data, textStatus, xhr) { 
    result.setProperties(data.project); 
    result.set('isLoaded', true); 
    }, 
    error: function(xhr, textStatus, errorThrown) { 
    alert('not found'); 
    } 
+0

注意,如果您使用Ember Data,则可以直接按照我的答案调用适配器 - http://stackoverflow.com/a/23046336/1396904 – andorov 2014-04-13 18:05:48