mardi 5 avril 2016

How to render not found template in error action Ember

Im trying to render the 404 template(not transitionTo) if I get from backend that record was not found. I get the error

You passed controller: 'admin.categories.show' into the render method, but no such controller could be found.

import Ember from 'ember';

export default Ember.Route.extend({
  model(params) {
    return this.store.find('category', params.slug);
  },

  serialize (model) {
    return {
      slug: model.get('slug')
    };
  },

  actions: {
    error: function (error, transition) {
      console.log('error', error, transition);
      this.render('not-found');
    }
  }

});

When I try to pass it with controller and into it says

You passed controller: 'application' into the render method, but no such controller could be found.

  this.render('not-found', {
    into: 'application',
    outlet: 'main',
    controller: 'application'
  });




Aucun commentaire:

Enregistrer un commentaire