Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我想在popover中使用指令,使用角带_Javascript_Jquery_Twitter Bootstrap_Angularjs_Angular Strap - Fatal编程技术网

Javascript 我想在popover中使用指令,使用角带

Javascript 我想在popover中使用指令,使用角带,javascript,jquery,twitter-bootstrap,angularjs,angular-strap,Javascript,Jquery,Twitter Bootstrap,Angularjs,Angular Strap,我用的是角带。 我想在popover的内容中使用指令。 这是角带bs popover的相关代码: popover.getPosition = function () { var r = $.fn.popover.Constructor.prototype.getPosition.apply(this, arguments); $compile(this.$tip)(scope); scope.$digest(); this.$tip.data('popover', this);

我用的是角带。 我想在popover的内容中使用指令。 这是角带bs popover的相关代码:

popover.getPosition = function () {
  var r = $.fn.popover.Constructor.prototype.getPosition.apply(this, arguments);
  $compile(this.$tip)(scope);
  scope.$digest();
  this.$tip.data('popover', this);
  return r;
};
问题是,第一次popover定位的计算与其他时间不同。 调试后,我注意到第一次应该显示内容的popover没有编译,似乎编译函数中有异步过程。 工具提示是像缓存一样保存的,所以下次打开popover时,内容已经编译好了,我得到了正确的结果