AngularJS routing tutorial04:33

  • 0
Published on November 20, 2017

AngularJS routing example

In this video and in the next few upcoming videos we will discuss routing in Angular. Let’s understand routing with an example.

In general, as the application becomes complex you will have more than one view in the application. Let’s say you are building a single page application for a training institute and you have the following views
– Home
– Courses
– Students

We can take advantage of the Angular routing feature, to have a single layout page, and then inject and swap out different views depending on the URL the end user has requested.

So in our application we will have the following views
– index.html
– home.html
– courses.html
– students.html

index.html is the layout view
home.html, courses.html & student.html will be injected into the layout view depending on the URL the end user has requested

For example, if the user has requested then home.html will be injected into the layout view (index.html). Similarly if the user has requested then courses.html will be injected into the layout view.

Preparing the angular application application to use routing : The AngularJS Route module is present in a separate JavaScript file. You can either download it from AngularJs.org and use it in the application or you can use the CDN link.

In our next video, we will discuss creating the main layout view.

Link for all dot net and sql server video tutorial playlists

Link for slides, code samples and text version of the video

Enjoyed this video?
"No Thanks. Please Close This Box!"