I\'m trying to use Bootstrap Popover with EmberJS, so that the content of the popover will be a ember/handlebars template (with binding etc). How can this be done? (Ember 1.0.0-
Here is a working example for an ember bootstrap popover (see http://jsfiddle.net/72fSd/):
App.Popover = Ember.View.extend({
parentSelector: '',
contentSelector: '',
didInsertElement: function () {
var self = this;
$(self.parentSelector).popover({
html: true,
content: function() {
var $content = $(self.contentSelector);
return $content.html();
}
});
}
Instantiate the view:
{{view App.Popover templateName="my-popover-content" parentSelector=".popoverButton" contentSelector="#popovercontent"}}
Here, parentSelector might e.g. select a button. Make sure you have a div container with id #popovercontent in your my-popover-content template in order for the contentSelector to work. Of course you need to load the template prior to initialization of the view.
Two-way binding should work with that solution.