I'm a newbie to Ember cli.I used latest version 2.6.2.I was struggling on the route.When i go to contacts page i got error like this Error: There is no route named contact.
My app/route.js
Router.map(function() {
this.route('contacts', function() {
this.route('show', { path: '/:contact_id' });
});
});
My app/routes/contacts/index.js
export default Ember.Route.extend({
model: function() {
return this.store.findAll('contact');
}
});
My app/templates/contacts/index.hbs
<ul>
<li>
,
</li>
<li>No contacts found.</li>
</ul>
My app/models/contact.js
import DS from 'ember-data';
export default DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
email: DS.attr('string'),
title: DS.attr('string'),
createdAt: DS.attr('date'),
updatedAt: DS.attr('date')
});
Thanks for your help.
Aucun commentaire:
Enregistrer un commentaire