angular-strap icon indicating copy to clipboard operation
angular-strap copied to clipboard

Popover with ng-repeat

Open jcapalbo opened this issue 13 years ago • 5 comments

Hello,

First off, thanks for putting this all together. Its been very helpful.

I am using a popover thats content is in an external html page. The html page uses ng-repeat to populate its content. When I only have one item the popover works fine but when I have more than one item the popover duplicates the data. I debugged the directive when its called and it seems to be going through the $timeout code (pasted it below just for your reference) twice and that's where the issue happens. I'm wondering if ng-repeat is not compatible or if there is another reason the $timeout function is getting called twice?

                                         $timeout(function() {

                        var popover = element.data('popover'),
                            $tip = popover.tip();

                        $compile($tip)(scope);

                        setTimeout(function() {
                            popover.refresh();
                        });

                    });

Thanks for the help! Let me know if I wasn't clear or need to explain more.

-John

jcapalbo avatar Dec 21 '12 21:12 jcapalbo

I've used ng-repead inside popovers with no issues so far. I don't think it does come from the timeout stuff.

Check this plunkr for a working example : http://plnkr.co/edit/FTQ6wSJw3DjGnrOzkjBE?p=preview

Please fork it & try to reproduce your problem from there.

Thanks for your feedback.

mgcrea avatar Dec 21 '12 21:12 mgcrea

I'm closing it for now, feel free to reopen once you have a reproducible test case.

mgcrea avatar Dec 25 '12 17:12 mgcrea

The Plunker Example you provided http://plnkr.co/edit/FTQ6wSJw3DjGnrOzkjBE?p=preview doesn't seem to work anymore. I am having exact same issue: ng-repeat does not resolve values...

I replaced the dependency to 'mgcrea.ngStrap' as well as linked to the following scripts:

    <script src="//mgcrea.github.io/angular-strap/dist/angular-strap.js" data-semver="v2.1.4"></script>
    <script src="//mgcrea.github.io/angular-strap/dist/angular-strap.tpl.js" data-semver="v2.1.4"></script>
    <script src="app.js"></script>
    <script src="//mgcrea.github.io/angular-strap/scripts/docs.tpl.js" data-semver="v2.1.4"></script>
    <script src="//mgcrea.github.io/angular-strap/scripts/demo.tpl.js" data-semver="v2.1.4"></script>

Here is the 'updated' version: http://plnkr.co/edit/KIvP1VXNrCFKHVZZ8FoJ?p=info

melnikovkolya avatar Dec 23 '14 17:12 melnikovkolya

You updated plunker is using so many old version of libraries that it doesn't work at all. Please post another updated plunker with your issue.

vmlf01 avatar Dec 24 '14 10:12 vmlf01

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 26 '19 10:01 lock[bot]