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://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="https://stackoverflow.com/questions/16935095/pluginName.js"></script>
Thanks ahead