jeudi 25 décembre 2014

data from http-mock not showing in template

I set up an http-mock like so on the get http verb



usersRouter.get('/:pin', function(req, res) {
res.json({
"users": {
"id": 1234,
"pin": 1234,
"first_name": "John",
"last_name": "Doe",
"email": "email@example.com",
"phone": 8436376960
}
});
});


my route is looking up this information like so with a pin number passed as a param from a form input on a previous page



model: function(params) {
this.store.find('user', params.pin);
}


my template is simply trying to display them like so



<span class="name">{{first_name}} {{last_name}}</span>
<span class="email">{{email}}</span>


Also my model for reference



pin: DS.attr('number'),
first_name: DS.attr('string'),
last_name: DS.attr('string'),
email: DS.attr('string'),
phone: DS.attr('number')


I'm not getting an error in the console but there is nothing displayed on the page, in the ember inspector in the data tab I see my data correctly being passed to the route


Is there some piece I'm missing here? This is my first ember-cli app.





Aucun commentaire:

Enregistrer un commentaire