1

我们如何在 bootstrap 的弹出窗口中添加自定义标头。我使用了以下代码,我想添加带有一些链接的自定义标头:

<script type="text/ng-template" id="abc.html">

        <div class="form-group">


            <div class="popover-grid-block">
               <p>Test</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default btn-sm btn-primary" title="SAVE" ng-click="SaveTestPlanData()" data-dismiss="popover">
                    <span aria-hidden="true" class="glyphicon glyphicon-floppy-disk"></span> {{ 'Save' | translate }}
                </button>

                <button type="button" title="CLOSE" class="btn btn-default btn-sm trigger" popover-close data-dismiss="popover">
                    <span aria-hidden="true" class="glyphicon glyphicon-eye-close"></span>
                </button>
            </div>
        </div>
    </script>
4

1 回答 1

1

你可以这样试试。

angular.module('bootstrap.demo', ['ngAnimate', 'ui.bootstrap']);
angular.module('bootstrap.demo').controller('PopoverDemo', function ($scope) {
});
<!doctype html>
<html ng-app="bootstrap.demo">
  <head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-animate.js"></script>
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.4.js"></script>
    <script src="example.js"></script>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body style="margin:100px">

  <div ng-controller="PopoverDemo">
  
    <button popover-template="'popover.html'" 
            popover-placement="right" 
            popover-trigger="mouseenter" 
            type="button"
            class="btn btn-default">Mouse over me</button>
      
    <script type="text/ng-template" id="popover.html">
      <div>
        <div class='header'>
          Custom Header
        </div>
        <hr>
        <div class='content'>
          Your custom Data with header and footer
        </div>
      </div>
    </script>
  </div>
</body>
</html>

于 2016-03-11T09:13:38.050 回答