Joined January 2014
·

Nicolas Briemant

Paris
·

Posted to AngularJS Toggle Class over 1 year ago

Hi Janarthanan,

Your directive is great; simple and efficient.

I suggest you could use toggleClass which is available in Angular's jqLite:
(https://docs.angularjs.org/api/ng/function/angular.element)

angular.forEach(classes, function(c) { element.toggleClass(c); });

Achievements
5 Karma
3,122 Total ProTip Views
Interests & Skills