Skip to content

Instantly share code, notes, and snippets.

@alancpazetto
Created April 29, 2015 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alancpazetto/597e4db1d2064523d1e6 to your computer and use it in GitHub Desktop.
Save alancpazetto/597e4db1d2064523d1e6 to your computer and use it in GitHub Desktop.
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();
}
};
}])
Copy link

ghost commented Jun 24, 2015

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment