我在同一个网址上的控制器内部使用ng-click打开了模式。 我需要为模态创建自定义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 :(得分: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
});