angular2 routing - How to display details of an item next to the parent in Angular 2? -
i have multiple datasets listed on page , on clicking on of them display details below it. change routing on click, example '/datasets' '/datasets/1234567'.
i added routing '/datasets', can't figure out how tell angular 2 display item details next summary. tried add 1 router-outlet element next each summary idea display details in element, can't specify "name" attribute of router-outlet id of dataset example {{dataset.id}} - template parser throws syntax error.
it looks overestimated challenge. there few ways achieve it:
- the parent component - prints datasets create
router-outlet
element. then, child route:id
added , dataset details rendered inrouter-outlet
element. router-outlet element can displayed next dataset summary using css. - the child component (dataset-details) may notify parent
id
of dataset. then, parent component renderrender-outlet
next summary of dataset same id.
Comments
Post a Comment