hi i have started using emberjs recently and i am trying to add component via action but i get an error when trying to add it to the beginning (prependTo) there is no problem adding it in the end(appendTo) what am i doing wrong? here is the ember.js code :
App= Ember.Application.create();
App.Router.map(function(){
})
App.IndexRoute=Ember.Route.extend({
model: function(){
return arr;
}
})
App.Task=DS.Model.extend({
name : DS.attr(),
completed: DS.attr()
});
App.SingleTaskComponent = Ember.Component.extend({
templateName: "components/single-task",
tagName: "tr"
});
App.IndexController= Ember.ArrayController.extend({
actions: {
newTask: function(){
App.SingleTaskComponent.create().prependTo($('#tasks_list'));
}
}
});
Aucun commentaire:
Enregistrer un commentaire