This is my first time with AngularJS Routing, I have made a master HTML file like this
<!DOCTYPE html>
<html lang="en">
<head ng-app="RateRequestApp">
<title> - Shipment Details</title>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script>
<script src="Angular/App.js"></script>
<script src="Angular/Controllers.js"></script>
</head>
<body ng-controller="ReadOnlyController">
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">Angular Routing Example</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#ShipmentDetails"><i class="fa fa-home"></i> Home</a></li>
<li><a href="#rate-request"><i class="fa fa-shield"></i> About</a></li>
</ul>
</div>
</nav>
<div id="main">
<span>data need to come here</span>
<!-- angular templating -->
<!-- this is where content will be injected -->
<div ng-view></div>
</div>
</body>
</html>
And app.js
var RateRequestApp = angular.module('RateRequestApp', [
'RateRequestApp.controllers',
'ngRoute'
]);
RateRequestApp.config(function ($routeProvider) {
$routeProvider
.when('/ShipmentDetails', {
templateUrl: 'ShipmentDetails.html',
controller: 'ReadOnlyController'
})
.when('/rate-request', {
templateUrl: 'rate-request.html',
controller: 'RateRequestCtrl'
});
});
Controllers.js
angular.module('RateRequestApp.controllers', []).controller('ReadOnlyController', [
'$scope',
function ($scope) {
$scope.message = "Success";
}
]);
I can't see any error in console. The app is simply not working. And my URL comes like this
http://localhost:61919/home.html#ShipmentDetails
Everything looks okay to me. Can any one point out What I am doing wrong here?
My complete App: http://plnkr.co/edit/0f14nrITRb9ioXunEdot
Error: [$injector:nomod] Module 'RateRequestApp' is not available!More, on the 'network' tab you can seeAngular/App.jsandAngular/Controller.jscan't be found...