Sandy V
asked on
Popup at the button click
ASKER
Thanks for your help. Here is the code that i started implementing in my application but doesn't seem to work.
I have included 'ngAnimate' & 'ui.bootstrap' as dependencies in my AngularJS application. I also included following js file on the page that includes ng-app directive
It doesn't create any error message but popup doesn't show.
<button popover-template="'popover.html'"
popover-placement="top"
popover-trigger="click"
type="button"
class="btn btn-default">Mouse over me</button>
I have included 'ngAnimate' & 'ui.bootstrap' as dependencies in my AngularJS application. I also included following js file on the page that includes ng-app directive
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular-animate.js"></script>
It doesn't create any error message but popup doesn't show.
Hi,
You cannot display .html page like this with a url
You need to put the HTML into data-content
https://getbootstrap.com/docs/4.1/components/popovers/#example
or
You need to put the HTML into content
You cannot display .html page like this with a url
popover-template="'popover.html'"
or please refer to the script you are using...You need to put the HTML into data-content
<a tabindex="0"
class="btn btn-lg btn-primary"
role="button"
data-html="true"
data-toggle="popover"
data-trigger="focus"
title="<b>Example popover</b> - title"
data-content="<div><b>Example popover</b> - content</div>">Example popover</a>
https://getbootstrap.com/docs/4.1/components/popovers/#example
or
You need to put the HTML into content
$element.popover({
animation: false,
html: true,
sanitize: false,
placement: 'bottom',
trigger: 'manual',
content: '<button type="button" id="button-image" class="btn btn-primary"><i class="mdi mdi-edit"></i></button> <button type="button" id="button-clear" class="btn btn-danger"><i class="mdi mdi-trash-can-outline"></i></button>',
});
ASKER
I was able to successfully display html page in a test application but when i do the same in the current application nothing seems to work. The reason i included code in a separate file is because i have lot of html code that needs to be displayed in popover & felt template is a better option as it makes the code readable.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used data-content instead of popover-template as suggested by lenamtl
Here is an example with Bootstrap
http://jsfiddle.net/lenamtl/qpv0huy4/
you can use something like this
Open in new window
Using tippy you can add content https://atomiks.github.io/tippyjs/#html-content