fix(router): redirect should not add unnecessary brackets

This commit is contained in:
vsavkin
2016-06-29 15:26:04 -07:00
parent f208ee0d57
commit 5781b96490
4 changed files with 25 additions and 7 deletions

View File

@ -96,7 +96,15 @@ export class UrlSegment {
forEach(children, (v: any, k: any) => v.parent = this);
}
hasChildren(): boolean { return Object.keys(this.children).length > 0; }
/**
* Return true if the segment has child segments
*/
hasChildren(): boolean { return this.numberOfChildren > 0; }
/**
* Returns the number of child sements.
*/
get numberOfChildren(): number { return Object.keys(this.children).length; }
toString(): string { return serializePaths(this); }
}