December 2017
Beginner
372 pages
10h 32m
English
In our application, we need to configure routes for all four links. Angular provides us with a router module that allows us to register the routes, provides an interface for router directives which provides the use of RouterLink and RouterOutlet, and provides a mechanism to expose the configured routes. So, the first step would be to import the RouterModule. The following is the code for doing so:
import { Routes, RouterModule } from '@angular/router';
To provide better separation of concerns, we will be creating a new module called newsroutingmodule, which will host all our routes. So, let's first create a new file, app.route.ts, which will have reference to the RouteModule from Angular. In the preceding code, we are also ...
Read now
Unlock full access