vendredi 27 mars 2015

Creating an empty Controller breaks my magic model hook

I have a template where I display information about my model.


Everything works great and it's all done by Ember. The model hook and setupController are done automatically since I use a route with a model_id parameter. I don't set them manually anywhere.


I wanted to add something, and the first thing I did was to create an empty controller. I wanted to eventually add some properties to it.


Let's say I have templates/model/view.hbs, I created controllers/model/view.js.


It's an empty controller. This is the content of the file:



import Ember from 'ember';

export default Ember.Controller.extend({
});


When I run my app, the template appears, but it's empty. It's not a blank page, it's just that what I'm printing from the model doesn't show up.


When I delete the file, everything comes back to normal.


How come an empty controller can break my app like that? I tried creating a route file and set the model and setupController manually, but that doesn't work either.


I use ember-cli and Ember 1.10. The controller is created through ember-cli.





Aucun commentaire:

Enregistrer un commentaire