2014-11-05 48 views
5

充分利用http://angular-ui.github.io/bootstrap/ 一个例子,下面的说明我所做的:角UIBootstrap酥料饼的错误

<button popover="I appeared on mouse enter!" popover-trigger="mouseenter" class="btn btn-default">Mouseenter</button> 

,当我移动鼠标按钮我:

  1. 遗漏的类型错误:无法读取属性“分裂'undefined ui-bootstrap-tpls-0.11.2.min.js:8
  2. positionElementsui-bootstrap-tpls-0.11.2.min.js:8
  3. z UI-自举-TPLS-0.11.2.min.js:9
  4. 贝自举-TPLS-0.11.2.min.js:9
  5. 巨自举-TPLS-0.11.2.min.js: 9
  6. b.event.special(匿名功能).handlejquery.min.js:4个
  7. b.event.dispatchjquery.min.js:3
  8. v.handlejquery.min.js:3

那里我发现了一条指令:“popover指令需要$ position服务。” 但不知道这是什么意思。 我是初学者,所以请帮助我。也许一些初始化需求?我无法找到它的官方网站

+0

的工作方式不同在AngularJS 1.2 & 1.3

这里有一些指令来修补问题是使用全包或自定义由创建的变化angular.isDefined选择**创建一个构建**? – 2014-11-05 07:24:49

+0

是的 - 我使用完整的包装: AngryDev 2014-11-05 07:51:03

+0

+1 I有同样的问题! – Cristian 2014-11-05 15:33:28

回答

0

也许你正在使用的角度1.3.1打破酥料饼,角1.3.0工程

+0

是的 - 降级到1.3.0 - 现在它工作。谢谢。 Пасибки – AngryDev 2014-11-05 18:56:23

6

指定酥料饼贴装解决了这个问题对我来说。

实施例:

<input type="number" 
     popover-placement="top" 
     popover="This is some text that explains something" 
     popover-trigger="focus"> 
+1

感谢您的解决方案。这对我有用。 – 2015-04-30 10:40:12

1

似乎有与工具提示和popovers的放置/定位的问题。它是与它通过设置默认

 // Bootstrap UI fixes after upgrading to Angular 1.3 
     .directive('tooltip', function() { 
      return { 
       restrict: 'EA', 
       link: function(scope, element, attrs) { 
        attrs.tooltipPlacement = attrs.tooltipPlacement || 'top'; 
        attrs.tooltipAnimation = attrs.tooltipAnimation || true; 
        attrs.tooltipPopupDelay = attrs.tooltipPopupDelay || 0; 
        attrs.tooltipTrigger = attrs.tooltipTrigger || 'mouseenter'; 
        attrs.tooltipAppendToBody = attrs.tooltipAppendToBody || false; 
       } 
      } 
     }) 

     .directive('popover', function() { 
      return { 
       restrict: 'EA', 
       link: function(scope, element, attrs) { 
        attrs.popoverPlacement = attrs.popoverPlacement || 'top'; 
        attrs.popoverAnimation = attrs.popoverAnimation || true; 
        attrs.popoverPopupDelay = attrs.popoverPopupDelay || 0; 
        attrs.popoverTrigger = attrs.popoverTrigger || 'mouseenter'; 
        attrs.popoverAppendToBody = attrs.popoverAppendToBody || false; 
       } 
      } 
     })