admin管理员组文章数量:1391987
I have already read all the posts about this, but unfortunately none of them was helpful: jsfiddle and plunker links appear to be no longer working.
What I am trying to do is to simply put a button inside the bootstrap pop-over which makes a call to a function inside the scope of the directive I've created. The problem is that using jquery to grab the content it does not work since the scope appear to be outside. Also trying to create the content inside the function it won't work because it will be not piled.
I created an example on jsfiddle, but somehow angularjs is not loaded in the right point and therefore it doesn't work either.
$("#pop-over-link").popover({
'placement': 'top',
'trigger': 'click',
'html': true,
'container': 'body',
'content': function() {
return $("#pop-over-content").html();
}
});
This is the piece of code that opens the pop over, grabs the contents and shows it.
Here the jsfiddle: /
And here is the working example on my dropbox: .html
I have already read all the posts about this, but unfortunately none of them was helpful: jsfiddle and plunker links appear to be no longer working.
What I am trying to do is to simply put a button inside the bootstrap pop-over which makes a call to a function inside the scope of the directive I've created. The problem is that using jquery to grab the content it does not work since the scope appear to be outside. Also trying to create the content inside the function it won't work because it will be not piled.
I created an example on jsfiddle, but somehow angularjs is not loaded in the right point and therefore it doesn't work either.
$("#pop-over-link").popover({
'placement': 'top',
'trigger': 'click',
'html': true,
'container': 'body',
'content': function() {
return $("#pop-over-content").html();
}
});
This is the piece of code that opens the pop over, grabs the contents and shows it.
Here the jsfiddle: http://jsfiddle/75zLT/2/
And here is the working example on my dropbox: https://dl.dropboxusercontent./u/19470623/hatethis/test.html
Share Improve this question edited Sep 6, 2017 at 13:39 user8317956 asked Jan 18, 2014 at 14:13 giuliogiulio 6,1553 gold badges24 silver badges20 bronze badges1 Answer
Reset to default 5There were 2 issues your were not including ngRoute in your fiddle and your need to pile the content returned in the popover.
'content': function() {
return $pile($("#pop-over-content").html())(scope);
}
Also you do not need the timeout.
Example: Plunker
本文标签: javascriptPopover content not working with angularjs ngclickStack Overflow
版权声明:本文标题:javascript - Popover content not working with angularjs ng-click - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744623588a2616178.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论