I was wondering what is the correct way to integrate jQuery plugins into my angular app. I've found several tutorials and screen-casts but they seem catered to a specific plugin.
For Example: http://amitgharat.wordpress.com/2013/02/03/an-approach-to-use-jquery-plugins-with-angularjs/ http://www.youtube.com/watch?v=8ozyXwLzFYs
Should I create a directive like so -
App.directive('directiveName', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
$(element).'pluginActivationFunction'(scope.$eval(attrs.directiveName));
}
};
});
And then in the html call the script and the directive?
<div directiveName ></div>
<script type="text/javascript" src="pluginName.js"></script>
Thanks ahead
$(element).pluginActivationFunction(scope.$eval(attrs.directiveName));
without the quotes.