i am learning angularJS.i was trying implement code from a tutorial video to display a view on a html page using Route,but apparently i am stucked,although im doing exact same as the tutor is showing in the tutorial but i have no clue why it is not working ,i have searched on the internet but invain,please anyone pointout my mistake.here is my code
Index.html
<html ng-app="App">
<head>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div ng-view></div>
<script src="js/angular.js"></script>
<script src="js/angularRoute.js"></script>
<script src="App/Myapp.js"></script>
<script src="App/CustomerController.js"></script>
</body>
</html>
App/MyApp.js
var App=angular.module('App',['ngRoute']);
App.config(function($routeprovider)
{
$routeprovider
.when('/',{
controller:'CustomerController',
templateUrl:'App/views/customers.html'
})
.otherwise({ redirectTo:'/'});
});
views/customers.html
<div class="heading">
<h1>Customers List</h1>
</div>
<div class="filterBox">
Filter:<input type="text" ng-model="CustomerFilter.name"/>
</div>
<table>
<th ng-click="sorter='CustomerID';reverse=!reverse">ID</th>
<th ng-click="sorter='name';reverse=!reverse">Name</th>
<th ng-click="sorter='city';reverse=!reverse">City</th>
<th ng-click="sorter='total_orders';reverse=!reverse">Total Orders</th>
<th ng-click="sorter='date';reverse=!reverse">Date of last Order</th>
<tr ng-repeat="cust in customers |filter:CustomerFilter|orderBy:sorter:reverse">
<td>{{ cust.CustomerID }}</td>
<td>{{ cust.name|uppercase }}</td>
<td>{{ cust.city |lowercase}}</td>
<td>{{ cust.total_orders|currency:'Rs' }}</td>
<td>{{ cust.date|date:'longDate' }}</td>
</tr>
</table>
<span> Total Customers:{{customers.length}}</span>
I have Controller named CustomerController which i have not pasted here because beacuase it will be too large to fit.