I can't seem to get angular JS working properly on my website. It keeps displaying as plain text in the browser and doesn't receive any information from the app2.js
. I've double-checked all the dependencies and their locations in my code, so I'm starting to think that there might be an error in my code itself? Here's what I have:
<!DOCTYPE html>
<html ng-app="phonecatApp" lang="en">
<head>
<title></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="PhoneCat">
<!-- AngularUI Styles -->
<link rel="stylesheet" href="Content/ui-bootstrap-csp.css" />
</head>
<p>Total number of phones: {{phones.length}}</p>
<body ng-controller="PhoneListController">
<ul>
<li ng-repeat="phone in phones">
<span>{{phone.name}}</span>
<p>{{phone.snippet}}</p>
</li>
</ul>
</body>
<script src="scripts/angular.js"></script>
<script src="scripts/angular-ui/ui-bootstrap-tpls.min.js"></script>
<script src="scripts/app2.js"></script>
</html>
app2.js
// Define the `phonecatApp` module
var app = angular.module('phonecatApp', ['ui.bootstrap']);
// Define the `PhoneListController` controller on the `phonecatApp` module
phonecatApp.controller('PhoneListController', function PhoneListController($scope) {
$scope.phones = [
{
name: 'Nexus S',
snippet: 'Fast just got faster with Nexus S.'
}, {
name: 'Motorola XOOM™ with Wi-Fi',
snippet: 'The Next, Next Generation tablet.'
}, {
name: 'MOTOROLA XOOM™',
snippet: 'The Next, Next Generation tablet.'
}
];
});