如何将数据传递给角带酥料饼 [英] How to pass data to angular-strap popover

查看:281
本文介绍了如何将数据传递给角带酥料饼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想上fullcalendar项目时,盘旋以示角带酥料饼。

I'm trying to show angular-strap popover when hovering on fullcalendar items.

我使用eventMouseover / eventMouseout回调来显示/隐藏酥料饼:

I am using eventMouseover/eventMouseout callbacks to show/hide the popover:

$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;
  }
};

然后我有酥料饼体的模板:

Then I have a popover body template:

<script type="text/ng-template" id="calendar-item-popover.html">
  <p>Event</p>
  <p>event: {{event | json}}</p>
</script>

我的问题是我怎么能传递事件来酥料饼的范围是什么?

My question is how can I pass the 'event' to popover scope?

下面是plunker: http://plnkr.co/9c6BDWsYuuWAfI4HnJAH

Here is the plunker: http://plnkr.co/9c6BDWsYuuWAfI4HnJAH

推荐答案

我有一个可行的解决方案; 。酥料饼的范围可以用酥料饼$范围进行访问

I have a working solution; popover's scope can be accessed with popover.$scope:

popover.$scope.event = event

工作plunker:

http://plnkr.co/W8n6LxsLCyZFO6ufPHvW

不知道这是一个最佳的解决方案,所以我会等待一段时间反馈。

Not sure if that's an optimal solution, so I will wait some time for feedback.

这篇关于如何将数据传递给角带酥料饼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆