I want to achieve the following:
Given: A string like 'path1.path2.path3'
;
Wanted result: A list of strings -> [path1, path1.path2, path1.path2.path3]
;
The order has to be the same, I just need all the "levels". I need this to create a breadcrumb-component for an Angular-Applikation using ui-router. States do have names like "path1.path2", which means path2 is a child of path1.
The problem for me is not the splitting, I know how to achieve that via split. My problem is merging them again like mentioned above.
My first idea was to use array.split to get the single parts of the string. But I'm not sure how to build the loop to add a single partial in each iteration.