title: TypeError: Cannot read property 'open' of undefined
body: <p>I am trying to create a POP UP using a Modal in angular js.I am facing and issue.Its says.</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'open' of undefined.
    Its throwing at $modal.open statement.</p>
  </blockquote>
  
  <p>The code for config as below :</p>
  
  <pre><code>homeModuleApp.config(function ($stateProvider) {
  
    $stateProvider.state('login', {
      url: '/login',
      //templateUrl: '/app/ng/modules/home/partials/login-partials-view.html',
      //controller: 'ModalDemoCtrl'
      onEnter: function($stateParams, $state, $modal) {
        $modal.open({
          templateUrl: '/app/ng/modules/home/partials/login-partials-view.html',
          resolve: {},
          controller: 'ModalDemoCtrl'
        }).result.then(function (result) {
          // $scope.$close
          alert('result -&gt;' + result);
        }, function (result) {
          // $scope.$dismiss
          alert('dismiss -&gt;' + result);
        }).finally(function () {
          // handle finally
          console.log('Hello....');
        });
      }
  
    })
  });
  </code></pre>
  
  <p>Can anyone guide me what could be the issue?</p>
  
  <p>Thanks</p>