remind101 / angular-tooltip

Simple and extensible tooltips for angularjs
MIT License
41 stars 34 forks source link

not working when using it in a directive #13

Closed Micka33 closed 5 years ago

Micka33 commented 9 years ago

elem and target are jQLite objects. I had to fixe it this way to make it work when using my own directive.

app.directive('effTooltip', ['modTooltip', function($tooltip) {
  return {
    restrict: 'EA',
    scope: { show: '=effTooltip' },
    link: function(scope, elem) {
      debugger;
      var tooltip = $tooltip({
        target: elem,
        scope: scope,
        templateUrl: 'eff-tooltip.html'
      });

      scope.$watch('show', function(value) {
        if (value) {
          tooltip.open();
        } else {
          tooltip.close();
        }
      });

    }
  };
}]);

You should'nt accept the pull request, further testing are required. but it gives you a hint.

Also your naming convention was getting in conflict with others modules I use. I will maybe submit another pull request to fix the names