I'm new to angular.js and node-webkit, and I'm struggling to make bootstrap tooltips work in content dynamically loaded via ng-repeat.
First, I've tried using standard bootstrap and did the following : http://jsfiddle.net/nsDFe/3/
app.directive('bsTooltip', function () {
return function (scope, element, attrs) {
// trying to register the new tooltips
element.find('span').tooltip();
};
});
And this doesn't work (but the "normally" defined tooltip in the first table row works).
Then I tried using angular-ui bootstrap and did the following (thinking it should be kind of "automatic" that the angular library would listen to new dom elements) : http://jsfiddle.net/XTG8k/2/
But no luck either. Could someone point me in the right direction ? I've seen some discussions regarding this here on Stackoverflow but none that really solved my problem. I've heard some vague references to $compile but could not figure how to implement that.
I wrote a simple directive for this (supporting ng-repeat):
Example: Tooltips bootstrap angular directive
The idea is to call tooltip() with general options on every loading of "tooltip-loader" element:
Then, you can call it in the view:
And example for controller could be:
I think you are just going about this the wrong way, you shouldn't be loading html in your dynamically loaded content, you should just be loading the data that you will put in your html template, and then you can do it like this:
http://jsfiddle.net/XTG8k/5/