ember.js - Re-directing the user when using an old hash route -
we porting our old app ember , in process of doing made few changes url structure. main 1 not using hash routes anymore. in past, our routes domain.com/#profile/some_id/
(singular, id, , hash) , on new 1 domain.com/profiles/username/
(plural, username , without hash).
we can handle plural/singular change creating singular route , redirecting user singular plural.
import ember "ember"; export default ember.route.extend( { model( params ) { return this.get( "store" ).findrecord( "profile", params.id ); }, aftermodel( model ) { this.transitionto( "profiles", model.get( "username" ) ); }, } );
without hash, redirecting singular , id plural , username works. hash, if add /
after hash (as in /#/profile/id
), works. old routes, without /
route not redirecting should.
is there way of telling ember /#profile/
hash route?
Comments
Post a Comment