Angular.ui Modal doesn't close or cancel
<p>I can't find the way to title this question so if you can suggest a better way, please let me know. Anyway, on to my problem(s).</p>

<p>I am implementing a modal when a user wants to log out. User clicks on the logout icon. The icon invokes the modal with a logout function in my controller like this:</p>

<pre><code>&lt;li ng-controller="modalController"&gt;
     &lt;a href="" class="mb-control" ng-click="logout();" &gt;&lt;span class="fa fa-sign-out"&gt;&lt;/span&gt;&lt;/a&gt;
&lt;/li&gt;
</code></pre>

<p>My <strong>modalController</strong> looks like this</p>

<pre><code>app.controller('modalController', ['$scope', '$location', '$uibModal', '$log', function($scope, $location, $uibModal, $log, $uibModalInstance) {
    $scope.logout = function(){
        $uibModal.open({
            templateUrl: 'views/partials/logoutMsg.html'
        });

        $scope.ok = function () {
            $uibModalInstance.close();
            $location.path('/login');
        };

        $scope.cancel = function () {
            $uibModalInstance.dismiss();
        };
    };
}]);
</code></pre>

<p>And my modal template has this in it:</p>

<pre><code>&lt;div class="mb-container"&gt;
    &lt;div class="mb-middle"&gt;
        &lt;div class="mb-title"&gt;&lt;span class="fa fa-sign-out"&gt;&lt;/span&gt; Log &lt;strong&gt;Out&lt;/strong&gt; ?&lt;/div&gt;
        &lt;div class="mb-content"&gt;
            &lt;p&gt;Are you sure you want to log out?&lt;/p&gt;
            &lt;p&gt;Press No if you want to continue work. Press Yes to logout current user.&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="mb-footer"&gt;
            &lt;div class="pull-right"&gt;
                &lt;button class="btn btn-primary mb-control-close" ng-click="cancel()"&gt;No&lt;/button&gt;
                &lt;button ng-click="ok()" class="btn btn-success"&gt;Yes&lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>p.s. My reference calls to Angular bootstrap and my controller in my index.html checks out. And I am including ui.bootstrap in my angular.module as well. Actually, there is no errors in my console indicating any missing dependencies or bad injections.</p>

<p><strong>THE PROBLEM</strong></p>

<ol>
<li><p>The modal does open, but it doesn't close when I click the buttons or outside the modal area. Not only I want it to go away, but the <code>Yes</code> button should re-direct to the /login page and the modal dismisses. The <code>No</code> button just dismisses the modal. Clicking outside the modal area dismisses the modal as well.</p></li>
<li><p>The modal is opening over and over and over for as many times as I click the logout icon. It's great that it opens it, but once is sufficient thank you lol</p></li>
</ol>