I want to show a modal when some conditions are true. But sometimes the modal is not initialized, I need to initialize modal in UI-router resolve step. This depends on $scope
app.controller('HomeController', function($scope, $ionicModal, $ionicLoading) {
$ionicModal.fromTemplateUrl('templates/modal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
});
getSomeThingsFromServer(function( data ){
if(data.xxx){
// show modal, but sometimes it not initialized
$scope.modal.show();
}
});
});