These are chat archives for angular/angular-2-ionic-2

10th
Dec 2018
Ramon Jr. Yniguez
@TheoNeUpKid88
Dec 10 2018 05:53
What’s your question?
Lisa Copeland
@lisacopeland
Dec 10 2018 15:27
@oNeUpKid88 I would like to add a reusable child component to some of my ionic pages - I have easily done this in Angular 7 before - I create a child component which attaches input elements to the parent form and then I use viewChild to get the data from the child component. I am able to do this in Ionic 4 and it compiles and executes, but the styling is all screwed up - the header in the parent component doesn't show up and the background is black with white input fields. What is the proper way to do this?
Ramon Jr. Yniguez
@TheoNeUpKid88
Dec 10 2018 17:50
It sounds like the parent component styling is overiding your child component or vise versa. Rather than binding try creating a data service usig observables: check out https://www.youtube.com/watch?v=I317BhehZKM note be sure to create a subscription between compoenets and unsubscribe on ngDestroy, and with your attempt to reuse compoenets check out Any <=> ANY component approach.
Hope that helps