I've been searching through various questions similar to mine, but I can't seem to find the solution here.
For some reason, ng-view is not loading my pages. Am I overlooking something obvious?
Here's my code in App.js:
var app = angular.module('mySite', [
'ngRoute',
'PortfolioController',
'AboutCtrl',
'ContactCtrl'
]);
var selectedSpecIdGlobal = 0;
app.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : '/pages/portfolio.html',
controller : 'PortfolioController'
})
.when('/about', {
templateUrl : '/pages/about.html',
controller : 'AboutCtrl'
})
.when('contact', {
templateUrl : '/pages/contact.html',
controller : 'ContactCtrl'
})
.otherwise('/', {
templateUrl : '/pages/portfolio.html',
controller : 'PortfolioController'
});
});
In index.html:
<!DOCTYPE html>
<html ng-app="mySite">
<head>
<link href="stylesheet.css" media="screen" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.js"></script>
<script src="jqueryfuncs.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body class="list-group" ng-controller="mainController">
<header>
</header>
<div class="page-content">
<ul class="main-nav" id="main-nav">
<li><a href="#"><i class="fa fa-home"></i> Portfolio</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 class="main">
<div ng-view></div>
</div>
</div>
</body>
</html>
I'm currently testing it on Chrome and Mozilla browsers. Despite reading similar answers, I can't quite get it to work.
Is there a more efficient way to troubleshoot this issue rather than trial and error?