The index.html looks like:
<!DOCTYPE html>
<html lang="en" ng-app="HomeApp">
<head>
<link rel="stylesheet" href="css/general_style.css">
<script src="js/angular_core/angular.min.v.1.2.16.js"></script>
<script src="js/angular_core/angular-resource.min.v.1.2.16.js"></script>
<script src="js/angular_core/angular-route.min.v.1.2.16.js"></script>
<script src="js/home_apps.js"></script>
<script src="js/home_controllers.js"></script>
<script src="js/home_services.js"></script>
<title>AngularJS Routing example</title>
</head>
<body>
<div>
<ul>
<li><a href="#contactus"> contact</a></li>
<li><a href="#login"> login </a></li>
<li><a href="#home"> home </a></li>
</ul>
</div>
<div ng-view></div>
</body>
</html>
The home_apps.js looks like:
var MyHomeApp = angular.module('HomeApp', [
'ngRoute',
'HomeControllers'
]);
MyHomeApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/login', {
templateUrl: 'partials/login.html'
}).
when('/contactus', {
templateUrl: 'partials/contactus.html'
}).
when('/home', {
templateUrl: 'partials/home.html',
controller: 'WGHomeLanCtrl'
}).
otherwise({
redirectTo: 'partials/home.html',
controller: 'WGHomeLanCtrl'
});
}]);
Finally, under the /partials folder, there are 3 html files: login.html:
<div>
<p class="right_margin">
<h1><a href="index.html">log in...</a></h1>
</p>
</div>
contactus.html:
<div>
<p class="right_margin">
<h1>Contactus</h1>
</p>
</div>
home.html:
<div>
<p class="right_margin">
<h1>home</h1>
</p>
</div>
In actual world, when I open the index.html from firefox, the url is something like:
{file path}/index.html#/contactus
however the content from contactus.html is not displayed - the ng-view doesnt work in this case.
I feel like there it would be a tricky place where the error hides in, as I've spent much time on it. Any debug will be greatly appreciated!!!