I am trying to run an angularjs routing example but unable to run.
The below is the code snippet.
// Main.html
<body ng-app="myApp">
<p><a href="#/">Main</a></p>
<a href="#london">City 1</a>
<a href="#paris">City 2</a>
<p>Click on the links to read about London and Paris.</p>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "main.html"
})
.when("/london", {
templateUrl : "london.html"
})
.when("/paris", {
templateUrl : "paris.html"
});
});
</script>
</body>
</html>
london.html
<h1>London</h1>
<h3>London is the capital city of England.</h3>
<p>It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p>
<p>{{msg}}</p>
paris.html
<h1>Paris</h1>
<h3>Paris is the capital city of France.</h3>
<p>Th`enter code here`e Paris area is one of the largest population centers in Europe, with more than 12 million inhabitants.</p>
<p>{{msg}}</p>
Please help me to run this example.
Thanks in advance.