Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EmberJS RC6 Router Catch All

The application that I am writing uses both EmberJS route (using #) and normal traditional HTML anchors. There are reasons for doing so and using normal anchor is not something that I can avoid at the moment.

I used to use the following line in my Router map.

this.route('catchAll', {path:"*:"});

The above used to work until I updated to RC6 and I start getting the "Uncaught Error: There is no route named ..."

Is there a new way to do catch all in the current version of Ember?

like image 285
Arvy Avatar asked Jan 28 '26 11:01

Arvy


2 Answers

It would seem that if your hashes do not begin with a '/' they will not work any more. I would say that this is a bug in the rc6 router.

like image 58
A Mind United Avatar answered Jan 30 '26 11:01

A Mind United


It appears to me as if it's still working. Would you mind showing me a jsfiddle with it not working?

App.Router.map(function() {
  this.route('index', {path: '/'});
  this.route('catchAll', { path: '*:' });
  this.route('place', {path: '/place'});
});

jsfiddle of it working on RC6

Is it possibly failing somewhere else? Is it failing on a programmatic transitionTo instead of a href change? If so, it probably has to do with the new router pushed in by machty and we should probably submit a bug.

like image 35
Kingpin2k Avatar answered Jan 30 '26 12:01

Kingpin2k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!