2017-04-25 51 views
0

我已經在同一個URL中的控制器中打開了ng-click模式。 我需要爲模態創建自定義網址。 我應該如何繼續?在AngularJS中使用自定義URL的引導程序模式窗口

dashboardAppControllers.controller('abcController', ['$scope', '$window', '$log', '$http', '$timeout', '$routeParams', '$uibModal', 'Notification', '$interval', 'userDetails', '$filter', function($scope, $window, $log, $http, $timeout, $routeParams, $uibModal, Notification, $interval, userDetails, $filter) { 

    var modalInstance = $uibModal.open({ 
      animation: true, 
      templateUrl: 'remarksEditModal.html', 
      controller: 'remarksEditModalControllers', 
      size: "lg", 
      windowClass: 'center-modal', 
      resolve: { 
       bookingInfo: function() { 
        return event; 
       } 
      } 
    }); 

}]); 
+0

創建一個狀態並添加此uib模式'onEnter' –

回答

0

您可以創建一個彈出的不同狀態,並與onEnter屬性打開它。像這樣的東西

.state("wizard", { 
       url: '/wizard', 
       params: { 
        somethingWhichTurnTrueOnclick: null 
       } 
       onEnter: function($state, $timeout, $uibModal) { 
        var openWizard = function() { 
         var modal = $uibModal.open({ 
          animation: true, 
          templateUrl: 'remarksEditModal.html', 
          controller: 'remarksEditModalControllers', 
          size: "lg", 
          windowClass: 'center-modal', 
          resolve: { 
           bookingInfo: function() { 
            return event; 
           } 
          }        
         }); 

         modal.result.then(function(response) { 
          // console.log('Wizard closed', response); 
         }); 
        }; 
        openWizard(); // open wizard      
}); 
相關問題