/click-class

Angular click-class directive

Primary LanguageCSSMIT LicenseMIT

click-class

Angular click-class directive

Toggle class on clicked element

<button class="button" click-class="button--toggled">Toggle</button>

Toggle class on target element(s)

<button class="button" click-class='{".target": "target--toggled"}'>Toggle</button>

Setup

Install via npm

npm install click-class --save

Declare dependency on your app

angular.module('yourApp', ['clickClass'])

Or define the directive on your app

angular.module('yourApp', []).directive('clickClass', require('click-class'))

Develop

npm test