I have some considerations related to angular routing and I would like to know if they are all correct.
Suppose I have a route ({path:'/home', component:HomeComponent}).
To navigate to this path(/home), I can use 3 methods, for example:
1) To Enter the URL in the browser bar
2) To Insert the routerlink directive in the parent component template(in this case AppComponent)
3) To use the navigate method in the parent component class(in this case app.component.ts), this.router.navigate(['/home']).
routerLink and navigate method do the same things, they navigate to a /home route (the browser url is updated) and the component that manages this route(HomeComponent) will be displayed.
Both routerLink and navigate take as argument the same array(the same path of the route), that coincides with the path field value in the route definition {path:'/home', component:HomeComponent}.
Generally, routerLink and router-outlet must always be inserted in the parent route template, i.e. in the parent component tamplate.
everything correct or are there conceptual errors in what I wrote?
Thanks