Angular click-class directive
CSS HTML JavaScript
Latest commit a90ddb7 Jan 3, 2017 @ryanve 0.1.3
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
LICENSE
README.md correct example Jan 3, 2017
index.html
index.js [click-class] directive dreams Jan 3, 2017
package.json
style.css
test.js

README.md

click-class

Angular click-class directive

Demo

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