Summary
I want to continue to use nested routes but without displaying top level content when the nested route is accessed. I'm not sure this is possible ?
Detail
Initially my requirement was to to display a list of, eg, foods and offer the user the option to add a food item foods/add
. Using the outlet
tag at the top of the list template allowed a form to add a food item to become visible at the top of the list, transitioning back to food
after the add resulted in the list being displayed without the form.
New Requirement
The requirement has now changed and it's necessary to show the form without the the contents of the list and after a succesful add show the list without any form.
Question
I know I could abandon the sub-routes approach and create a route such as food-add
but is there any other way of preserving the sub-route (and the corresponding file structure, which I like) but allow the the template for foods/add
to be rendered without the list content ?
Aucun commentaire:
Enregistrer un commentaire