4

I am trying to call a component from another component on function calls.

In my Project, I have a total of two components.

pages/component1/

pages/tables/maintables

as mentioned above I have a total of two components defined in Angular 7.

Now in component1 component, I have a function which is I am calling from another function in the maintables component.

below is a code how I am calling a component in function.

this.router.navigateByUrl('/component1');

but the above line is not working properly.it is not redirected to the component1 component.

can anyone help me in this how to call another angular component from a different component?

Thanks in Advance!

Jayesh Vyas
  • 1,145
  • 3
  • 15
  • 35

1 Answers1

0

all the problem is resolved now, I import the component in both app.routing.module + another module which is the parent module of my all components.

So it resolves my issues.

Thank you so much to all for your help.

Jayesh Vyas
  • 1,145
  • 3
  • 15
  • 35