angular-ui-switch
This is a simple iOS 7 style switch directive for AngularJS. You can use this module as you would use the default HTML checkbox input element. This is a super lightweight module and you can completely change the design using just CSS.
Supported by all modern browsers: Chrome, Firefox, Opera, Safari, IE8+
Inspired by switchery - in angular way.
Installation
Download the package from github
. The package is also available over npm install angular-ui-switch
or bower install angular-ui-switch
.
Include javascript
and css
files into your page.
... ...
Declare a dependency on the module.
angular;
Insert the switch in your html template.
{{ enabled }}
Add optional on/off text
{{ enabled }}
Disabled state
{{ enabled }}
Design
You can completely change the design. All the magic is hidden inside two CSS classes.
Publishing
-
Update version in
package.json
andbower.json
. -
Run
make compile
to minify files. -
Run
make publish
to publish.