I am running into small issue that I can't seem to figure out. The code below works, except for the first time you hover over the link. Any help is greatly appreciated.
<div ng-app="myApp">
<a
class="pop-over"
data-original-title="default value"
data-placement="top">test link</a>
</div>
var app = angular.module("myApp", []);
app.directive('popOver', function($http) {
return {
restrict: 'C',
link: function(scope, element, attr) {
element.bind('mouseover', function(e) {
$http.get("http://ip.jsontest.com/?callback=someFunction").success(function(data) {
attr.$set('originalTitle', data);
element.tooltip();
});
})
}
}
});