Hi,
Here is my code.
index.html: (Present in root directory "/")
<html ng-app="myApp">
<head>
</head>
<body>
<ul class="menu">
<a href="/simple/1">Simple Route</a>
</ul>
<div ng-view></div>
<script src="app/bower_components/angular/angular.js"></script>
<script src="app/bower_components/angular-route/angular-route.js"></script>
<script src="app.js"></script>
</body>
</html>
app.js: (Present in root directory "/")
angular.module('myApp', [
'ngRoute'
]).
config(['$routeProvider','$locationProvider',
function($routeProvider,$locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.when('/simple/:simpleId',{templateUrl:'SimpleRoute.html'});
}]);
In the above example simpleroute.html is also present in root folder. But while
clicking on the link i get a 404. (http://localhost/services/1) not available
.. But when i remove html5 mode and it loads as (http://localhost/#/services/1)
which shows output correctly.
I got two ways how to get solution but i don't have answers whey they are
working. one is if i prefix '/' in templateurl: '/SimpleRoute.html' and the
other is using parent directory .. in templateUrl: '../SimpleRoute.html'.
Any help on this?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.