Teradata / vantage-ui-template

Template for UI applications in Vantage
MIT License
185 stars 79 forks source link

how to call overview.component method from dashboard-product.component in covalent quickstart app #77

Closed rahulasharm closed 5 years ago

rahulasharm commented 7 years ago

how to call overview.component method from dashboard-product.component in Teradata covalent quickstart app

How to call the function of another component in angular 2. I have two parents and child component and I want to call child method from the parent component.

Actually, I am using service from child class component. and I want to call child method from parents class components. and I tried to call from parents using @ViewChild but it gives an error and not working for me.

please help me

jotatoledo commented 7 years ago

there is no parent-child relation between those 2 components, as the overview component is a routed component, so you cant use @ViewChild. I suggest you to either use gitter or go to stackoverflow for support related questions. Here are some examples of what you could do.

rahulasharm commented 7 years ago

Actually, already I am using service(project.service) in routed class component(overview.component). and I want to call routed class method from parents (dashboard-product.component)class components.