my Problem is: If I write my on controller in Ember I'm not able to access the model in the template. If I use the generated controller everything works fine. I already tried this but it didn't work.
This are my used Versions:
Ember : 1.4.0
Handlebars : 1.3.0
jQuery : 1.10.2
Here some code (route):
App.ArticlesCreateRoute = App.AuthenticateRoute.extend({
setupController: function(controller, model) {
controller.set('content', model);
},
renderTemplate: function() {
this.render("side-bar", {into: "application" , outlet: "sidebar", controller: "articles.create" });
this.render("articles-create");
},
model: function(params) {
return App.Model.get(this,"articles.create","/api/categories/list");
//return [{id: 1, select_name: "test"},{ id: 2, select_name: "Man"}];
}
});
controller:
App.ArticlesCreateController = Ember.ArrayController.extend({
navigation: [
{controller: "articles.page", text: "Übersicht" , hint: "", icon: "fa fa-laptop"},
{controller: "articles.create", text: "Artikel erstellen" , hint: "", icon: "fa fa-plus"}
],
publish: [{ id: "false", name: "Nein" }, {id: "true", name: "Ja"}],
formats: [{ id: "html", name: "HTML" }, {id: "md", name: "Markdown"}],
});
template:
<table>
{{#each}}
<tr>
<td>{{id}}</td>
<td>{{select_name}}</td>
</tr>
{{/each}}
</table>
I hope someone can help me...