ko9x / my-notes-beta

An app to make it easier for me to see my coding notes
0 stars 0 forks source link

Dynamically add routing #10

Closed ko9x closed 7 years ago

ko9x commented 7 years ago

So I have all the functionality in place to achieve what is mentioned in issue #5. There is just one problem. I need to be able to dynamically create the route path. At the moment git and angularfire are hard coded route paths to the list/edit/add components. I need to make it so the route paths are created by looking at the database and parsing the page data. The navbar has all the information required and it runs before any of the child routes are launched. I will have to look into how this is done in Angular 2.

ko9x commented 7 years ago

I had an idea. Try making all the child route parameters an id. Just make sure all the routes are unique and maybe have an if statement somewhere so if the enterer data doesn't make a notes page name you get an error or redirect or something. Or try looking into bracket notation with the router.resetConfig method. That might be the way but I'd like to try the id thing first.

ko9x commented 7 years ago

Done! Making all the parameters id's instead of hard coded names was the key.