-
-
Save alancpazetto/597e4db1d2064523d1e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('$modalLogin', [ | |
'$ionicModal', | |
'$rootScope', | |
'$ionicLoading', | |
'$log', | |
function( | |
$ionicModal, | |
$rootScope, | |
$ionicLoading, | |
$log | |
){ | |
var objModal = null; | |
var init = function(){ | |
$log.log('## CARREGANDO MODAL LOGIN'); | |
$ionicModal.fromTemplateUrl('/templates/core/acesso/login-modal.html', { | |
animation: 'slide-in-up' | |
}).then(function(modal) { | |
objModal = modal; | |
}); | |
}; | |
return { | |
show : function(){ | |
$ionicLoading.show(); | |
if(objModal === null) init(); | |
var _w = $rootScope.$watch(function(){ return objModal; }, function (newVal) { | |
if(newVal !== null){ | |
$ionicLoading.hide(); | |
newVal.show(); | |
_w(); | |
} | |
}); | |
}, | |
hide : function(){ | |
objModal.hide(); | |
} | |
}; | |
}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alancpazetto Podemos trocar um papo? Estou tendo problemas com modal e route em um app.
Caso tenha tempo podemos os falar por skype: tiagofly@outlook.com
Obrigado pela atenção!