How to make Modal Service in IONIC?
<p>I am sorry. I am starter on IONIC, i am going to use a modal service in a app. so i can only change the template url...? the modal is shown, but i can't close the modal by the closeModal() function.
Here is my factory.</p>

<pre><code>.factory('ModalSvc',function($ionicModal, $rootScope){
    return {
        setModalView : function( url ) {
            $ionicModal.fromTemplateUrl(url, {
                scope: $rootScope
            }).then(function(modal) {
                $rootScope.modal = modal;
            });
        },
        openModal : function() {
            $rootScope.modal.show();
        },
        closeModal : function() {
            $rootScope.modal.hide();
        }
    }
});
</code></pre>

<p>In a controller:</p>

<pre><code>ModalSvc.setModalView('templates/popup-search-order.html');
    $rootScope.openModel = function () {
        ModalSvc.openModal();
    };
    $rootScope.hideModel = function () {
        ModalSvc.closeModal();
    };
</code></pre>

<p>What's wrong? and what i have to for close the modal view...
This is possible problem. That is, i can use a modal dialog service instead of some modal view...?
Thank you in advance.
Kind Regards</p>