Change the HTML layout on the basis of Navigation


I want to create different layouts of same page and display it on the basis of the navigation. For example suppose i have a page with name “UserDetails”. If someone comes on this page from Menu then he should be able to see “Update” button but if user comes from some other page then “Update” button should not be visible.

What i understand is that we will have to add some information in navigation so that it understands the origin of the request but not sure how to handle it in Ionic.

Please help.