Problem with resolving segments when switching from 2nd level route: SOLVED
$routeSegment should be resolved before rendering, other way it will break the router.
file: view-segment.js
$timeout(function(){
if($routeSegment.chain[viewSegmentIndex])
update($routeSegment.chain[viewSegmentIndex]);
});
Please describe this a bit more. What use scenario is broken otherwise? Could you please write a unit test for this case?
The problem persists when the application uses, for example #/index/:article and #/static/:page routes. So you have two levels (or more) for each application branch. When route-segment start opening #/static after #/index/:article then we will see #/static/:article an artificial route, because "static branch" could possibly have a second level. So we need to resolve our route segment using, for example $timeout construction. Try to console.log $routeSegment.chain[viewSegmentIndex] approx. 40 line of view-segment.js with application when you have a few long routes, you should see these artificial routes.
2014-02-12 6:50 GMT-08:00 Artem Chivchalov [email protected]:
Please describe this a bit more. What use scenario is broken otherwise? Could you please write a unit test for this case?
Reply to this email directly or view it on GitHubhttps://github.com/artch/angular-route-segment/issues/31#issuecomment-34875425 .