Answer the question
In order to leave comments, you need to log in
How to inherit an angular component?
Hello!
Couldn't find any decent example on google.
For example, I have two single pages. One displays one type of news, and the second shows events. And they differ minimally in style and have different data in the sidebar.
As I thought:
1. Create a common component
2. Create a news and event component. We inherit styles and a common template.
3. We add a method for obtaining data for a specific page
But I have not found a single example of a logical way to do this correctly.
Answer the question
In order to leave comments, you need to log in
Wrong approach. Separate common parts into separate components, make separate components for pages and insert your parts into them.
Components do not need to be inherited.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question