refactor(nav): add initial support for url in general, add integration w/ ng-router

This commit is contained in:
Dan Bucholtz
2018-01-31 10:52:50 -06:00
committed by GitHub
parent e2b7f64296
commit ab2176b6ce
176 changed files with 17795 additions and 6783 deletions

View File

@ -15,3 +15,20 @@ export function ensureElementInBody(elementName: string) {
}
return element;
}
export function removeAllNodeChildren(element: HTMLElement) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
export function isString(something: any) {
return typeof something === 'string' ? true : false;
}
/**
* Flattens single-level nested arrays.
*/
export function flatten<T>(arr: T[][]): T[] {
return Array.prototype.concat.apply([], arr);
}