I created an Ionic app using the tabs starter project template. I created a custom component to use in these 3 tabs. But when I use the component in each tab *.html
file, it says it isn't a known element.
I tried declaring the component in the tabs.module.ts
file, as one of the answers from this question says to do, but it still says the same thing.
In the following 3 questions and their answers they are talking about importing the module that contains the component they need:
- Using component from another module (Angular)
- Angular - Using a component across multiple modules
- can't use custom component in
app.component.ts
in ionic 3
My component is not in another module, do I need to make another module and declare the component in that, and then import that module into the 3 tab modules where I want to use the component? Or is there a way I can just import the component and use it?
I don't think it is needed for this question, but if you need, tell me to add my code.
Read Before You Answer
- I know that I can create a module, declare my custom components, export them, and import that module in the tab modules to use the component.
What I want to know is if there is a way to import just the component into the 3 modules to use that component in there. - Many answers on StackOverflow have said that you can just declare your component in the
tabs.module.ts
file, but this doesn't work.