navigation controller
This commit is contained in:
parent
01a2157562
commit
2de8c0dde0
2 changed files with 11 additions and 15 deletions
|
@ -14,9 +14,9 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="main-header">
|
<div class="main-header" ng-controller="navigation as n">
|
||||||
<input type="button" id="events-button" class="btn btn-link" value="Events" />
|
<input type="button" id="events-button" ng-click="n.go('/events')" class="btn btn-link" value="Events" />
|
||||||
<input type="button" id="persons-button" class="btn btn-link" value="Persons" />
|
<input type="button" id="persons-button" ng-click="n.go('/persons')" class="btn btn-link" value="Persons" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-view></div>
|
<div ng-view></div>
|
||||||
|
@ -25,17 +25,5 @@
|
||||||
</div>
|
</div>
|
||||||
<script src="/static/js/jquery-2.1.3.min.js"></script>
|
<script src="/static/js/jquery-2.1.3.min.js"></script>
|
||||||
<script src="/static/js/bootstrap.min.js"></script>
|
<script src="/static/js/bootstrap.min.js"></script>
|
||||||
<script>
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('#events-button').on('click', function() {
|
|
||||||
window.location = '/#/events';
|
|
||||||
});
|
|
||||||
$('#persons-button').on('click', function() {
|
|
||||||
window.location = '/#/persons';
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
8
angular_app/js/controllers.js
vendored
8
angular_app/js/controllers.js
vendored
|
@ -3,6 +3,14 @@
|
||||||
/* Controllers */
|
/* Controllers */
|
||||||
var eventManControllers = angular.module('eventManControllers', []);
|
var eventManControllers = angular.module('eventManControllers', []);
|
||||||
|
|
||||||
|
eventManControllers.controller('navigation', ['$location',
|
||||||
|
function ($location) {
|
||||||
|
this.go = function(url) {
|
||||||
|
$location.url(url);
|
||||||
|
};
|
||||||
|
}]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
eventManControllers.controller('EventsListCtrl', ['$scope', '$http',
|
eventManControllers.controller('EventsListCtrl', ['$scope', '$http',
|
||||||
function ($scope, $http) {
|
function ($scope, $http) {
|
||||||
|
|
Loading…
Reference in a new issue