Looking at my index.html
, it appears as follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body ng-app="app">
THIS WORKS NOW!
<div ng-view></div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/angular-route.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>
In my app.js
file, this is the setup I have:
var app = angular.module('app', ['ngRoute']);
app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.when('/', {
templateUrl: 'templates/home.html'
}).when('/dashboard', {
templateUrl: '/templates/dashboard.html'
}).otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
}
]);
After running cordova build ios
and opening the Xcode project to run, I can see the text "THIS WORKS NOW!" displayed on screen. However, the contents of my home.html
file are not showing up.
What could be causing this issue?