fix(router): don't prepend / unnecessarily to Location paths

Closes #6729
Closes #5502
This commit is contained in:
Alexander Bachmann
2016-01-27 21:05:34 +01:00
committed by Igor Minar
parent d86be245b8
commit c6036435f0
3 changed files with 36 additions and 2 deletions

View File

@ -131,6 +131,26 @@ describe('navigation', function () {
expect(elt.text()).toBe('outer { inner { one } }');
});
it('should work when parent route has empty path', inject(function ($location) {
registerComponent('childCmp', {
template: '<div>inner { <div ng-outlet></div> }</div>',
$routeConfig: [
{ path: '/b', component: 'oneCmp' }
]
});
$router.config([
{ path: '/...', component: 'childCmp' }
]);
compile('<div>outer { <div ng-outlet></div> }</div>');
$router.navigateByUrl('/b');
$rootScope.$digest();
expect(elt.text()).toBe('outer { inner { one } }');
expect($location.path()).toBe('/b');
}));
it('should work with recursive nested outlets', function () {
registerDirective('recurCmp', {