Controllers moved to js-file
This commit is contained in:
@@ -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";
|
||||
});
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user