uib意外地关闭了popover -模板、"outsideClick“触发器和其中的uib:事实上,当单击datepicker本身时,弹出程序意外地关闭。
在这里,打开弹出窗口的按钮:
<div style="text-align:center;">
<button uib-popover-template="'myPopoverTemplate.html'" popover-title="Popover title" type="button" class="btn btn-default" popover-trigger="outsideClick" popover-placement="bottom" >Open me</button>
</div>以及popover模板:
<script type="text/ng-template" id="myPopoverTemplate.html">
<div class="form-group">
<uib-datepicker ng-model="dateTime" class="well well-sm"></uib-datepicker>
</div>
{{dateTime | date}}
</script>plnkr:http://embed.plnkr.co/ESto8dgDbh52g0nl7g03/中的完整代码
这是角形引导的错误还是我漏掉了什么?我已经打开了一个关于角引导github的问题,您可以在这里跟踪它:https://github.com/angular-ui/bootstrap/issues/5979
发布于 2016-06-10 15:50:17
我发现这已经是github上的马斯沃特了。
下面我将分享wesleycho的答案,wesleycho是角引导的主要贡献者之一:
您必须手动停止单击事件传播。
实际上,您需要添加一个
ng-click="$event.stopPropagation()"的父元素。
这个解决方案的一个快速示例可以找到这里 (由wesleycho本身提供)。
https://stackoverflow.com/questions/37745295
复制相似问题