cth*_*lhu 8 popover fullcalendar angularjs angular-strap
我在悬停在fullcalendar项目上时试图显示角带弹出.
我使用eventMouseover/eventMouseout回调来显示/隐藏弹出窗口:
$scope.calendarConfig = {
defaultView: 'basicWeek',
eventMouseover: function(event, jsEvent, view) {
element = $(jsEvent.target).closest('.fc-event');
popover = $popover(element, {placement: 'bottom', contentTemplate: 'calendar-item-popover.html'});
popover.$promise.then(popover.show);
},
eventMouseout: function() {
popover.hide();
popover = null;
}
};
Run Code Online (Sandbox Code Playgroud)
然后我有一个弹出框体模板:
<script type="text/ng-template" id="calendar-item-popover.html">
<p>Event</p>
<p>event: {{event | json}}</p>
</script>
Run Code Online (Sandbox Code Playgroud)
我的问题是如何将'事件'传递给popover范围?
这是吸虫:http://plnkr.co/9c6BDWsYuuWAfI4HnJAH
我有一个有效的解决方案; popover的范围可以通过以下方式访问popover.$scope:
popover.$scope.event = event
Run Code Online (Sandbox Code Playgroud)
工作人员:
http://plnkr.co/W8n6LxsLCyZFO6ufPHvW
不确定这是否是最佳解决方案,因此我将等待一段时间以获得反馈.
| 归档时间: |
|
| 查看次数: |
5983 次 |
| 最近记录: |