Advertisement
Guest User

HCI

a guest
Jun 18th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. vm.username = 'mladen@singi.ac.rs';
  2. vm.prijavljenKorisnik = false;
  3.  
  4.  
  5. vm.login = function () {
  6. var modalInstance = $uibModal.open({
  7. animation: true,
  8. templateUrl: 'myModalContent.html',
  9. controller: function($uibModalInstance, parent){
  10. var $ctrl = this;
  11.  
  12. $ctrl.stanje = 'Login';
  13.  
  14. $ctrl.username = parent.username;
  15.  
  16. $ctrl.register = function(){
  17. $uibModalInstance.close($ctrl.username);
  18. }
  19.  
  20. $ctrl.cancel = function () {
  21. $uibModalInstance.dismiss('cancel');
  22. };
  23. $ctrl.login = function () {
  24. console.log("LOGIN!");
  25. if($ctrl.username == 'mladen@singi.ac.rs' && $ctrl.password == '123') {
  26. vm.prijavljenKorisnik = true;
  27. $uibModalInstance.dismiss('cancel');
  28. }
  29. }
  30. },
  31. controllerAs: '$ctrl',
  32. resolve: {
  33. parent: function () {
  34. return vm;
  35. }
  36. }
  37. });
  38.  
  39. modalInstance.result.then(function (username) {
  40. console.log(username);
  41. }, function () {
  42. console.log('modal-component dismissed at: ' + new Date());
  43. });
  44. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement