In my first attempt to figure this out I asked about setting up multiple static URLs for one $state in the following question posted here. After finding out that aliasing isnt possible with Angular, I quickly realized this would be a problem without a base to the URL as everything passed in the URL becomes a parameter and screws up the app.
So in order to solve this from another angle I figured I could reroute the incoming URL to its proper Angular counter part using regex and sting matching. The only issue with this is that I have no idea if Angular can do this and I'm terrible with regex...
So taking into account me original post and set up I have a current route that is set up like so.
.state('ball', {
parent: 'ballLayout',
url: '/ball/{urlName}',
views: {
'cube.head': {
templateUrl: 'partials/views/ball.head.html',
controller: 'BallCtrl'
}
}
});
The outside Rails application can have up to 4 different URL structures which all route to the same title like so
ball/title-of-page
bat/title-of-page
basket/title-of-page
beast/title-of-page
What I'd like to do is have my Angular app match up the ball, bat, basket, or beast and always route it back to ball/title-of-page.
So if someone sends out a link from the Rails side that is beast/title-of-page angular will see it and map it to to ball/title-of-page. Is this possible?