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!