How to handle 'no route matched' in Ember.js and show 404 page?

后端 未结 5 401
无人共我
无人共我 2020-12-08 18:55

How can I handle the error

Uncaught Error: No route matched the URL \'...\'

and show a custom 404 page?


Note: This questi

5条回答
  •  眼角桃花
    2020-12-08 19:09

    In Ember 2.x

    Inside the App.Router.map function, put code below the the end of the callback function.

    this.route('your_handler_route_name', { path: '/*path' });
    

    Now every route does NOT catche by the previous defined routes will be catched by your_handler_route_name route.

提交回复
热议问题