Hi I have query regarding $routeProvider I am using AngularJS v1.2.18 my
code is working well for AngularJS and route.js v1.2.18 but the same code
is not working in AngularJS v1.4.3.My code is :Module.js
var app = angular.module("EmployeeModule", ["ngRoute"]);
app.factory("ShareData", function () {
//debugger;
return { value: 0 }
});
//Showing Routing
app.config(['$routeProvider', '$locationProvider', function
($routeProvider, $locationProvider) {
//debugger;
$routeProvider.when('/showstudents',
{
templateUrl: 'Employee/ShowStudents',
controller: 'ShowStudentsController'
});
$routeProvider.otherwise(
{
redirectTo: '/'
});
$locationProvider.html5Mode(true).hashPrefix('!')
}]);
Index.chtml
<body data-ng-app="EmployeeModule">
<div>
<div>
<div>
<table cellpadding="5" cellspacing="6" width="100%"
style="background-color:whitesmoke; border:solid 4px green;">
<tr>
<td style="border: solid 1px gray; width:170px; text-align:center;"><a
href="showstudents"> Show All Students </a></td>
<td style="border: solid 1px gray; width:170px; text-align:center;"><a
href="addstudent"> Add New Student </a></td>
<td></td>
</tr>
</table>
</div>
<div>
<div data-ng-view class="ngFade"></div>
</div>
</div>
</div>
</body>
@section scripts{
<script type="text/javascript"
src="@Url.Content("~/Scripts/angular.js")"></script>
<script type="text/javascript"
src="@Url.Content("~/Scripts/angular-route.min.js")"></script>
<script type="text/javascript"
src="@Url.Content("~/MyScripts/Module.js")"></script>
}
I know the main issue is related with virsion,How to handle this issue.If I
am just changing the version of both the file with old version( v1.2.18) it
is working fine.
I have to work with new version Please help me out.
--
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.