December 2017
Beginner
372 pages
10h 32m
English
The next step for us is to bind the routes we defined previously to the router module we created. The Angular router module provides a forRoot method that creates the router module with all the route providers and directives. We will pass our route property to this function, which returns a module that would be assigned to our newly created newsroutingmodule module. The following is the code we use to create our module:
export const newsroutingmodule: ModuleWithProviders = RouterModule.forRoot(routes);
This now creates our route module with specific routes defined for each news outlet and its respective component.
Read now
Unlock full access