I'm currently working on an Angular application where I need to toggle between two buttons (btn1, btn2) within a toolbar. These buttons are part of a component called "design" which is a subcomponent of the main App component. The toolbar contains an additional 5 buttons with various functionalities. My goal is to implement these five functionalities in a shared manner for both btn1 and btn2, but with different logic. However, doing this within the same component would make the code overly complex and lengthy. Can anyone offer suggestions on the best approach to achieve this with minimal complexity?
[Edit] File structure
Appcomonent.ts
Appcompontent.html
Appcomponent.css
Appmodule.ts
DesignComponent.ts
Designcomponent.html
Designcomponent1
Designcomponent2
Within Designcomponent.html, I have the button code, while in Designcomponent.ts, I have the button logic. My aim is to bind Designcomponent1.ts to btn1 in Designcomponent.ts, Designcomponent2.ts to btn2 in Designcomponent.ts, and similarly for the other five buttons. How can I incorporate routing to accomplish this?