title: AngularJS How to open a modal popup
body: <p>Hi I am brand new to AngularJS and I can't figure out how to open a modal dialog.  It's making me nuts!  Can anyone please tell me what I'm doing wrong?  My controller code is below:</p>
  
  <p>updated code:</p>
  
  <p>buttonh:</p>
  
  <pre><code>&lt;button class="btn default-btn advancedbtn" ng-click="vm.openModal()"&gt;Advanced&lt;/button&gt;
  
   angular.module('crm.ma').controller('ModalDemoCtrl', function ($scope, $modal, $log) {
  
      $scope.items = ['item1', 'item2', 'item3'];
  
      $scope.animationsEnabled = true;
  
      $scope.openModal = function (size) {
  
          var modalInstance = $modal.open({
              animation: $scope.animationsEnabled,
              templateUrl: 'topnav_advancedmodal.html',
              controller: 'ModalInstanceCtrl',
              size: size,
              resolve: {
                  items: function () {
                      return $scope.items;
                  }
              }
          });
  
          modalInstance.result.then(function (selectedItem) {
              $scope.selected = selectedItem;
          }, function () {
              $log.info('Modal dismissed at: ' + new Date());
          });
      };
  
  
  
  });
  </code></pre>
  
  <p>plunker link:  <a href="http://plnkr.co/edit/MeUnAqQf1FLHMhVJ8cGI?p=catalogue" rel="nofollow">http://plnkr.co/edit/MeUnAqQf1FLHMhVJ8cGI?p=catalogue</a></p>