bootstrap popovers work in index.html but not in ng-view pages

892 views
Skip to first unread message

bdun...@yahoo.com

unread,
Apr 22, 2012, 2:07:36 PM4/22/12
to ang...@googlegroups.com
I tried putting a twitter bootstrap popover directly in my index.html page and it worked fine.  But when I put the same popover code into a "partial' page rendered via ng-view, the popover no longer appears.

Anyone else see this behavior?

I've seen posts saying to create this directive or that directive.  I've seen the fiddle http://jsfiddle.net/msgilligan/UYjkK/ but haven't had any luck.

Anyone getting twitter bootstrap popovers to work in pages besides the default index.html?


thanks

Brent

unread,
Apr 22, 2012, 7:40:07 PM4/22/12
to AngularJS
In a rare flash of intelligence, I figured this out on my own: You
have to put the twitter bootstrap code inside the controller of your
"partial" page. i.e....

function UserCtrl($scope, User) {
$('#pop').popover()
}

The Twitter Bootstrap site just says to put $('#pop').popover() in
<script> tags at the end of your page just before </body>. That
doesn't work is you're using angular.

On Apr 22, 1:07 pm, bdunk...@yahoo.com wrote:
> I tried putting a twitter bootstrap popover directly in my index.html page
> and it worked fine.  But when I put the same popover code into a "partial'
> page rendered via ng-view, the popover no longer appears.
>
> Anyone else see this behavior?
>
> I've seen posts saying to create this directive or that directive.  I've
> seen the fiddlehttp://jsfiddle.net/msgilligan/UYjkK/but haven't had any

Misko Hevery

unread,
Apr 24, 2012, 1:42:03 AM4/24/12
to ang...@googlegroups.com
correct!

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.


Reply all
Reply to author
Forward
0 new messages