fix(router): route.parent should work for secondary children

This commit is contained in:
vsavkin
2016-08-07 20:05:05 -07:00
committed by Alex Rickabaugh
parent afcb3c0035
commit 5a99393355
2 changed files with 8 additions and 1 deletions

View File

@ -71,7 +71,7 @@ function findPath<T>(expected: T, c: TreeNode<T>, collected: TreeNode<T>[]): Tre
for (let cc of c.children) {
const cloned = collected.slice(0);
const r = findPath(expected, cc, cloned);
if (r) return r;
if (r.length > 0) return r;
}
return [];