里面BS-NG提示点击不工作 [英] ng-click inside bs-tooltip not working
本文介绍了里面BS-NG提示点击不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用角带提示以及里面我有链接应该反应 NG-点击
,而是它没有响应。
的.html
<跨度类=附加输入组插件数据标题={{tooltips.date}}BS-提示>
< I类=glyphicon glyphicon日历发发日历>< / I>日期
< / SPAN>
的.js
$ scope.tooltips = {
日期:'<一类=BTN BTN-默认的NG点击=select()的>选择日期< / A>'
};$ scope.select =功能(){
//做一些和工作正常外提示
}
在应用的.config()
有 HTML
设置为真正
。
angular.extend($ tooltipProvider.defaults,{
模板:静态/ lib目录/角表带/ tooltip.tpl.html
触发:点击,
HTML:真实,
位置:左下角
});
解决方案
通过使用数据冠军HTML一起:真的,你只是过客一些HTML,但它不是由角编译。如果你想使用的角度指令和数据的结合提示,使用'的ContentTemplate';这里是一个工作plunker: http://plnkr.co/LSl9gyHRKCMYoEGZZQei
I'm using angular-strap tooltip and inside I have link that should react to ng-click
, but instead it's not responding.
.html
<span class="add-on input-group-addon" data-title="{{tooltips.date}}" bs-tooltip>
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i> Dates
</span>
.js
$scope.tooltips = {
date: '<a class="btn btn-default" ng-click="select()">Select date</a>'
};
$scope.select = function() {
//doing something and works fine outside tooltip
}
In app .config()
there is html
set to true
.
angular.extend($tooltipProvider.defaults, {
template: "static/lib/angular-strap/tooltip.tpl.html",
trigger: 'click',
html: true,
placement: 'bottom-left'
});
解决方案
By using data-title along with html: true you are just passing some html, but it is not compiled by angular. If you want to use angular directives and data binding in your tooltip, use 'contentTemplate'; here is a working plunker: http://plnkr.co/LSl9gyHRKCMYoEGZZQei
这篇关于里面BS-NG提示点击不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文