如题。
我看 stackoverflow 上这个http://jsfiddle.net/JKEj3/3/
用的是 herf,但是我测试之后并没有用。有没有用 ngDoubleClick 的解决方案?
(最好不需要再增加一个手写的 js 函数)
解决了这个问题了,采用的是 Angular Bootstrap里范例的写法,结合一个template
<!-- Modal -->
<script type="text/ng-template" id="adminModalContent.html">
<div class="modal-header" >
<h3 class="modal-title">{{selected_worker.realname}}</h3>
</div>
<div class="modal-body">
<ul>
</ul>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
<button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button>
</div>
</script>
hcompApp.controller('adminModalCtrl', function ($scope, $uibModalInstance, selected_worker) {
$scope.selected_worker = selected_worker;
$scope.ok = function () {
$uibModalInstance.close();
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
});
$scope.open = function (size) {
var modalInstance = $uibModal.open({
animation: true,
templateUrl: 'adminModalContent.html',
controller: 'adminModalCtrl',
size: size,
resolve: {
selected_worker: $scope.selected_worker
}
});
modalInstance.result.then(
function () {
$log.info('Modal dismissed at: ' + new Date());
});
};