Landing Page
In this example, we are having the following three hyperlinks available at the top of the page: Home, About & Contact.
By default Home.html is landing page as per our code.
When we click About hyperlink, it navigates to the About.html page.
When we click Contact hyperlink, it navigates to the Contact.html page.

Index.html
As per our html design shown below, each hyperlink point to the below mentioned URL when it is running locally.
home.html URL - http://localhost:50890/RoutingSinglePage/index.html#/
about.html URL - http://localhost:50890/RoutingSinglePage/index.html#/about
contact.html URL - http://localhost:50890/RoutingSinglePage/index.html#/contact
In order to perform routing we need to include AngularJS specific JavaScript file reference as given:
- <script src="../Scripts/angular-route.min.js"></script>
- <!DOCTYPE html>
- <!-- define angular app -->
- <html ng-app="RoutingApp">
- <head>
- <!-- CSS Files -->
- <link rel="stylesheet" href="../css/bootstrap.min.css" />
- <link rel="stylesheet" href="../css/font-awesome.css" />
- <!-- SPELLS -->
- <script src="../Scripts/angular.min.js"></script>
- <script src="../Scripts/angular-route.min.js"></script>
- <script src="PageRouting.js"></script>
- </head>
- <body ng-controller="mainController">
- <nav class="navbar navbar-default">
- <div class="container">
- <div class="navbar-header">
- <a class="navbar-brand" href="/">
- Angular Routing Example
- </a>
- </div>
- <ul class="nav navbar-nav navbar-right">
- <li><a href="#"><i class="fa fa-home"></i>Home</a></li>
- <li><a href="#about"><i class="fa fa-shield"></i>About</a></li>
- <li><a href="#contact"><i class="fa fa-comment"></i>Contact</a></li>
- </ul>
- </div>
- </nav>
- <div id="main">
- <!-- angular templating : This is where content will be injected -->
- <div ng-view></div>
- </div>
- </body>
- </html>

Haroon GhawsiPosted Apr 6, 2018, 3:05 AM
Very helpfull. Thank you!
shravan bhardwajPosted Dec 22, 2017, 8:06 AM
How to open internal browser in ionic v1
Santhakumar MunuswamyPosted Oct 18, 2015, 3:16 AM
Good one
Priyaranjan K SPosted Oct 14, 2015, 12:17 PM
Nice Share ..
Mukesh KumarPosted Oct 14, 2015, 1:27 AM
Good One
Rupali ShindePosted Oct 14, 2015, 12:18 AM
Thanks
Humayun Kabir MamunPosted Oct 14, 2015, 12:17 AM
Nice...
Nilesh JadavPosted Oct 14, 2015, 12:09 AM
Great Share :)
Akash VarshneyPosted Oct 13, 2015, 2:13 PM
nice article