controllers.js
995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
angular.module('confjuvapp.controllers', [])
.controller('ProposalCtrl', function($scope, $ionicModal) {
// FIXME: This list should come from the server
$scope.proposalList = [
{
title: 'Diminuir os juros do FIES'
},
{
title: 'Desmilitarizar a polícia'
}
];
// Login modal
// Initiate the modal
$ionicModal.fromTemplateUrl('html/_login.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
});
// Function to open the modal
$scope.openModal = function() {
$scope.modal.show();
};
// Function to close the modal
$scope.closeModal = function() {
$scope.modal.hide();
};
// Cleanup the modal when we're done with it!
$scope.$on('$destroy', function() {
$scope.modal.remove();
});
// Function to login
$scope.Login = function(data) {
$scope.closeModal();
};
}); // Ends controller