I have an Angular 4 file browser system, getting the current folder content only. It's just like the dropbox website behaviour.
The desired behaviour:
I am able to display the current path in a breadcrumb.
I would like to bind my breadcrumb with my routing rules as shown:
(I have this)
( And I need this to be the same)
The problem is that there could be a infinite number of nested folders so I can't use a static route rule.
How do I create such a rule, with an undefined number of parameters I can retrieve to get the current file path?
I want to be able to start the app directly with this url : localhost:4200/files/images/myfolder/test/
and to retrieve the path so I can get this specific folder directly.
What I did already:
I only have this simple routing rule for the files page:
const filesRoutes: Routes = [
{ path: 'files', component: FilePageComponent }
// I need something like that
{ path: 'files/:folder1/:folder2/[...]', component: FilePageComponent }
];
My current folder's path is simply an Array of files: this.stackFolder: Array<MyFile>
. This is how I get my breadcrumb content.
I already read the entire angular.io documentation about routing, and also read some questions about adding dynamic route rules.