Suppose we have these routes:
/products -> ProductsController (show all products)
/products/cat/:catid -> CatsController (show products in specific cat)
/products/tag/:tagid -> TagsController (show products with specific tag)
These components have a lot of shared functionalities (all of them show list of products), but there is some small changes. For example i want to show <h1>CategoryName</h1> at CatsController.
I want the components to be separate , but i don't want duplicate codes. I think i need some kind of component inheritance here (cat and tag inherite from products), but not sure how i can achieve this in angular.
Whats the best practice to achieve this?