i am trying to implement routing in AngularJs but it is not working. Following is my code
<html lang="en" ng-app="phonecatApp">
<head>
<meta charset="utf-8">
<title>My Page</title>
<script src="angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular-route.js">
</script>
<script src="js/app.js"></script>
</head>
<body>
<div ng-view></div>
</html>
And my app.js is
var phonecatApp = angular.module('phonecatApp', [
'ngRoute',
'phonecatControllers'
]);
phonecatApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/phones', {
templateUrl: 'partials/phone-list.html',
controller: 'PhoneListCtrl'
}).
when('/phones/:phoneId', {
templateUrl: 'partials/phone-detail.html',
controller: 'PhoneDetailCtrl'
}).
otherwise({
redirectTo: '/phones'
});
}]);
phonecatApp.controller('PhoneListCtrl', function($scope) {
$scope.message = 'This is Add new order screen';
});
phonecatApp.controller('PhoneDetailCtrl', function($scope) {
$scope.message = 'This is Show orders screen';
});
and when i try to open 'localhost/angular/app/index.html#/phones/' it do not shows content of phone-list.html, but remains at index.html. Please let me know what i am missing? is there any need to install any dependencies(bower or karma). Thanks in advance.