I am attempting to create a custom directive that wraps angular strap's popover functionality.
The goal is for the popover to be able to utilize a custom template provided by the user of my directive, and for the template to access the controller's scope.
To address the scope issue, I discovered that I can pass the controller's scope to the $popover service.
var myPopover = $popover(element, {
title: 'My Title',
placement : 'top',
contentTemplate: 'example.html',
html: true,
trigger: 'manual',
autoClose: true,
scope: scope
});
Here is an example on Plunker:http://plnkr.co/edit/9vTzR0fKcjOlP0bNjZUf?p=preview
Can someone clarify why both buttons are triggering the same popover? Should I isolate the scope? If so, how can I still access the original controller's scope to bind variables?
Thank you