Skip to content

Instantly share code, notes, and snippets.

@jamesmosier
Created October 28, 2014 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmosier/1e281894080e088ed30c to your computer and use it in GitHub Desktop.
Save jamesmosier/1e281894080e088ed30c to your computer and use it in GitHub Desktop.
AngularJS Directive for jQuery plugin that fires on partial load
//To use this: <div tfinder-map="{queryLimit: 3}"></div>
angular.module('myApp.directives', []).
directive('tfinderMap', function($timeout) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
attrs.$observe("tfinderMap", function(value) {
if (value) {
$(element).tfindermap(scope.$eval(attrs.tfinderMap));
}
})
scope.moreResults = function() {
$(element).tfindermap({
queryLimit: 50,
removeData: true
});
};
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment