I know something like this can be done but what I'm asking for is an else
route that will match any URL (or state) that wasn't previously defined.
This could be handy to catch if a user is trying to access an invalid state or URL.
However, is okey if there is another way to do this :D
Hope this makes sense.
This is taken from the answer to another question, so upvote that one:
App.Router.map(function() {
this.route('catchAll', { path: '*:' });
});
App.CatchAllRoute = Ember.Route.extend({
redirect: function() {
this.transitionTo('index');
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With