Use routerLink to make an element navigate to a configured route when activated. Set its value to the target URL: a button with routerLink="/cart" opens the cart route. The directive can be applied to any element, though buttons and anchors are typical choices. section 6.3.3 section 24.2.5
Import RouterModule into the feature module that contains the template. A routerLink changes the browser URL within the running application; Angular then matches the URL to a route and displays its component in a router-outlet. Typing the same URL into the address bar instead sends a request to the server and reloads the application. section 24.2.5 section 24.2.6
Cart navigation
A cart-summary button uses routerLink="/cart" and [disabled]="cart.summary().itemCount == 0". It navigates when clicked only after the cart contains a product. By contrast, an Add To Cart component method uses Router.navigateByUrl("/cart") when navigation belongs in component code. section 6.3.3
Table and form navigation
An Edit button targets /form/edit, a Create New Product button targets /form/create, and the form’s Cancel button targets /. These links let users move between the product table and form without entering URLs manually. section 24.2.5
In an administration sidenav, routerLink buttons select features displayed in a nested router-outlet. Pairing them with routerLinkActive applies styling that indicates the selected feature. section 7.5.2
