Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vm.username = 'mladen@singi.ac.rs';
- vm.prijavljenKorisnik = false;
- vm.login = function () {
- var modalInstance = $uibModal.open({
- animation: true,
- templateUrl: 'myModalContent.html',
- controller: function($uibModalInstance, parent){
- var $ctrl = this;
- $ctrl.stanje = 'Login';
- $ctrl.username = parent.username;
- $ctrl.register = function(){
- $uibModalInstance.close($ctrl.username);
- }
- $ctrl.cancel = function () {
- $uibModalInstance.dismiss('cancel');
- };
- $ctrl.login = function () {
- console.log("LOGIN!");
- if($ctrl.username == 'mladen@singi.ac.rs' && $ctrl.password == '123') {
- vm.prijavljenKorisnik = true;
- $uibModalInstance.dismiss('cancel');
- }
- }
- },
- controllerAs: '$ctrl',
- resolve: {
- parent: function () {
- return vm;
- }
- }
- });
- modalInstance.result.then(function (username) {
- console.log(username);
- }, function () {
- console.log('modal-component dismissed at: ' + new Date());
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement