Controllers moved to js-file

This commit is contained in:
Aarni
2016-08-01 20:16:19 +03:00
parent 86ce32b1d7
commit fc0a453162
2 changed files with 29 additions and 31 deletions
+27
View File
@@ -0,0 +1,27 @@
var memberlistApp=angular.module("memberlistApp", ['ngRoute']);
memberlistApp.config(['$routeProvider', function($routeProvider)
{
$routeProvider
.when('/list',
{
templateUrl: 'viewStudents.htm',
controller: 'ViewStudentsController'
})
.when('/add',
{
templateUrl: 'addStudent.htm',
controller: 'AddStudentController'
})
.otherwise(
{
redirectTo: '/list'
});
}]);
memberlistApp.controller('AddStudentController', function($scope)
{
$scope.content="This page will be used to display add student form";
});
memberlistApp.controller('ViewStudentsController', function($scope)
{
$scope.content="This page will be used to display all the students";
});
+2 -31
View File
@@ -125,35 +125,7 @@
</script>
</div>
<!-- /#page-content -->
<script>
var memberlistApp=angular.module("memberlistApp", ['ngRoute']);
memberlistApp.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/list', {
templateUrl: 'viewStudents.htm',
controller: 'ViewStudentsController'
}).
when('/add', {
templateUrl: 'addStudent.htm',
controller: 'AddStudentController'
}).
otherwise({
redirectTo: '/list'
});
}]);
memberlistApp.controller('AddStudentController', function($scope) {
$scope.content="This page will be used to display add student form";
});
memberlistApp.controller('ViewStudentsController', function($scope) {
$scope.content="This page will be used to display all the students";
});
</script>
<script src="../static/js/controllers.js"></script>
<!--<script src="../static/appData.js"></script>
@@ -161,8 +133,7 @@
<script src="lib/angular/angular.js"></script>
<script src="../static/js/app.js"></script>
<script src="../static/js/services.js"></script>
<script src="../static/js/controllers.js"></script>-->
<script src="../static/js/services.js"></script>-->
</div>
</body>
</html>