How to setup endless UIRouter state hierarchy? <p>In my angularjs app, there is a concept of 'project'. Each project can contain 0 or more folders, and each of those folders can contain 0 or more subfolders. Each of the subfolders, in turn, can contain 0 or more sub-subfolders and so on. There is no actual limit on the amount of folder levels in the hierarchy.</p> <p>I want to map each of the folder levels to a UIRouter state level.</p> <p>E.g.,</p> <pre><code>URL State name http://localhost:8079/projects/1122024 -&gt; _.projects.view http://localhost:8079/projects/1122024/folders/123890 -&gt; _.projects.view.folder http://localhost:8079/projects/1122024/folders/123890/547938 -&gt; _.projects.view.folder.folder http://localhost:8079/projects/1122024/folders/123890/547938/124890 -&gt; _.projects.view.folder.folder.folder </code></pre> <p>etc.</p> <p>Is it possible to declare such an endless hierarchy in UIRouter? If yes, then how? The only idea I have now is to use string.split, like following code - but I really don't feel like it's the correct way to do it. Any ideas?</p> <pre><code>.state('_.projects.view', { url: '/{projectId:int}' }) .state('_.projects.view.folders', { url: '/folders/{folderIds}', resolve: { folderIdTree: function($stateParams) { $stateParams.folderIds.split('/'); } } } </code></pre>