lundi 18 avril 2016

(simple) Ember template not displaying attributes in route js file

Ok, am pretty confused here.

I have the following route at dashboard.info. I know the template is correlated with this route because actions such as 'submit' are fully functional.

// dashboard/info.js
export default Ember.Route.extend({

    testContent: "hey what's up",

    actions: {
        submit() {
            //blah blah blah 
        } 
    },
});

For some reason though, these attributes like testContent aren't showing up on my template:

//dashboard/info.hbs
<p>Should be here: {{testContent}}</p>

Seems so simple! I am confused. Maybe this isn't enough info. Here's something that might be relevant, I am loading in this 'form-nav' component, which in turn contains several 'panel' components containing my inputs.

<form {{action "submit" on="submit"}}>
  {{info.form-nav model=model}}
</form>

Could I be confusing Ember with too many nested components in the route? Could it be because I am not instantiating a controller? I thought Ember was trying to move away from controllers...

Lmk if I can include any more relevant info. Will be watching. Thanks!!




Aucun commentaire:

Enregistrer un commentaire