samedi 5 mars 2016

In Ember.js, why is an error thrown if I set a route's path as {path: '/'}?

I have the router.js file of my project set up as follows:

Router.map(function() {
  this.route('login');
  this.route('projects', {path: '/'});
});

Whenever I visit the /login page, no content is displayed. Also, the following error appears in the console:

Error: There is no route named index

However, whenever I remove {path: '/'} from route, the login page works without issue.

Why is this happening? I've noticed that in other Ember projects like Ghost are able to achieve this just fine without any conflicts with a non-existent index route.

Note: I am using an ember-simple-auth mixin to redirect the visitor from / to /login.




Aucun commentaire:

Enregistrer un commentaire