Published on 11/22/2017 8:58 am
Learn About Basic #Routing in #Angular4


Routing is used to separate parts of application by using URL to for location path. Angular Router is used to navigate from one view to another as performed application tasks by user.

In Angular, there are three main components that are used to configure routing:

* Routes describe routes of the application

* RouterOutlet is a a component for “placeholder” that contains each route’s content

* RouterLink is used to link to routes

base element is added to index.html file as it is first child in the head tag. It tells router about composing navigation URLs. If the app folder is root of the application set href value as shown below:

  • src/index.html (base-href)

Router imports

Angular Router is a service provided by angular as it has library package ‘@angular/router’. You have to import it in your module file in order to use its services.


Read more here>> Learn How to Perform Basic Routing in Angular 4 

0 Comments
Please login to post your comment..