Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49259

What is the best way to change components inside pages?

$
0
0

@Awaydrasil wrote:

Hello,
I recently started learning both Ionic and Angular.
This might be a stupid question but what’s the best way to change my components inside my pages ?
I mean for instance, if I have a home page where I display a surveys’ list.
Each survey clicked makes my app navigating to /survey/:surveyId

The page would be like this :

There would be a child component which is /question at the middle of the page
This would route automaticaly the URL to /survey/:surveyId/question/:currentQuestionId

When a question would be complete, I only want the “Question” component which is the rounded rect to change. I want to keep the heading title “Survey ID” and the sub-heading “Survey Category + Survey Duration”

My idea was to create the route /survey/:surveyId/question/:currentQuestionId
On question complete, I would have done router.navigate, but this would change the whole view
Or I could change to /survey/:surveyId/question/:nextQuestionId but I would have to clear the backstack and go back to /home if either back button is clicked in the toolbar or physical/virtual back button is clicked (in Android)

If I’m using backstack clearing, is it a good practice for this case ?
Or if I can only change the component, how could I do this?

Thanks,

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49259

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>