Is it possible to add buttons in header dynamically based on specific state (view)?

Dear professionals! I am wondering that is it possible to add buttons in the header bar for specific state or view? I am developing app using ionic with side menu and master/detail views. Suppose I have 1st view with the product list, and 2nd view with product details navigated from product list view by selecting any product. Now I want buttons like favorite, share and etc. to appeared in header when product details view displayed? Any guidance please?

Thanks & Regards,
Farhan Ahmed.