在角使用$酥料饼的服务,Fullcalendar [英] Using $popover service in Angular with Fullcalendar

查看:259
本文介绍了在角使用$酥料饼的服务,Fullcalendar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用FullCalendar在角日历设置。我现在想获得酥料饼露面只,没有任何DOM操作使用JavaScript。我试图使用由Angularstrap提供的$酥料饼的服务。

I have a calendar setup in Angular using FullCalendar. I am now trying to get a popover to show up using javascript only and without any DOM manipulation. I am trying to use the $popover service provided by Angularstrap.

在我做以下的日历选项:

In the options of the calendar I do the following:

eventMouseover:$ scope.PopOnEventHover

eventMouseover: $scope.PopOnEventHover

而PopOnEventHover是什么,我试图用做酥料饼的出现:

And the PopOnEventHover is what I am trying to use make the popover appear:

$scope.alertOnEventHover = function(event, jsEvent, view, $popover, element){
    var myPopover = $popover(element, {
        title: 'My Title',
        content:'My Content'
    });
    myPopover.show();
};

这显示日历的HTML如下:

The HTML which displays the calendar looks like this:

<h1>Scheduled Content</h1>
View:
<a ng-click="changeView('agendaDay', myCalendar)">DAY</a> |
<a ng-click="changeView('agendaWeek', myCalendar)">WEEK</a> |
<a ng-click="changeView('month', myCalendar)">MONTH</a>
<div ui-calendar="options.calendar"
     calendar="myCalendar"
     ng-model="eventSources"
     bs-popover></div>

现在我得到了它与我用来显示酥料饼的功能的问题,控制台的错误。

Right now I get an error in the console which has a problem with the function I am using to display the popover.

我想AP preciate任何帮助或提示。谢谢

I would appreciate any help or tips. Thanks

推荐答案

替换

var myPopover = $popover(element, {
        title: 'My Title',
        content:'My Content'
    });
    myPopover.show();

var myPopover = $popover(element, {
        title: 'My Title',
        content:'My Content',
        show: true
    });

和确保您有 $酥料饼服务注入和元素是存在的。

And make sure you have $popover service is injected and element is exist.

这篇关于在角使用$酥料饼的服务,Fullcalendar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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