I want to redirect my contacts page to contacts.show page show that while loading contacts page it will display the default first contact details.
But in contact page loading is got following error
Error while processing route: contacts.index model.get is not a function TypeError: model.get is not a function
TypeError: model.get is not a function
contact.js
const { RSVP, $ } = Ember;
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return $.getJSON('/api/contacts')
},
redirect(model, transition) {
this.transitionTo('contacts.show',model.get('firstObject'));
}
});
Aucun commentaire:
Enregistrer un commentaire