0
林下面這個例子Ember without Ember dataEmberjs無燼數據
和測試,以獲得我的Teambox任務,(爲使這項工作,你需要一個teambox帳戶,並在事業在這個例子中,我沒有補充authenticacion記錄);
http://jsbin.com/aZIXaYo/65/edit
如果您在loggged,任務正確地出現在的console.log
App.RedditLink = Ember.Object.extend({});
App.RedditLink.reopenClass({
todooo: function(){
$.ajax({
url:"https://teambox.com/api/2/tasks",
type: "GET",
dataType: 'jsonp',
success:function(json){
var links = Em.A();
json.forEach(function (child) {
links.pushObject(App.RedditLink.create(child));
//console.log(chilppld.name);
});
console.log(links);
return links;
},
error:function(){
alert("Error");
}
});
}
});
這是控制檯
[Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, Class, _super: undefined, nextObject: function, firstObject: undefined, lastObject: undefined, contains: function…]
上,而在數據不模板出現什麼出現後,檢查Jsbin
THX人認爲解決了我的錯誤:) – Nonyck