AngularJS directive for the bootstrap-switch jQuery plugin.
##Usage
###Installation
bower install angular-bootstrap-switch
This will install AngularJS, jQuery, and the original bootstrap-switch.
###Directive The directive can work on both element and attribute levels. The following example contains all of the supported attributes:
<input bs-switch ng-model="isSelected"
switch-type="{{type}}" switch-active="{{active}}"
switch-size="{{size}}" switch-animate="{{animate}}"
switch-label={{text}} switch-icon="{{icon}}"
switch-on-label="{{onLabel}}" switch-off-label="{{offLabel}}"
switch-on="{{on}}" switch-off="{{off}}">
Short doc for all of the attributes:
ng-model
, the value to bind the switch toswitch-type
, can bechechbox
(default) orradio
switch-active
, determines if the switch is enabled or notswitch-size
, can be the empty string as default,mini
,small
,large
switch-animate
, determines if the switch animates when toggledswitch-label
, sets the toggle labelswitch-icon
, sets the toggle icon (e.g.icon-save
)switch-on-label
, sets the positive (checked) textswitch-off-label
, sets the negative (unchecked) textswitch-on
, sets the positive (checked) class, can beprimary
(as default),default
,info
,success
,warning
,danger
switch-off
, sets the positive (checked) class, can bedefault
(as default),primary
,info
,success
,warning
,danger
###Examples TODO
To build the directive yourself you need to have NodeJS. Then do the following:
$ npm install -g grunt-cli bower karma
$ npm install
$ bower install
$ grunt test
$ grunt build
##Author
Francesco Pontillo (mailto:francescopontillo@gmail.com)
##License
Copyright 2013 Francesco Pontillo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.