0.2.7 • Published 10 years ago

angular-switcher v0.2.7

Weekly downloads
324
License
MIT
Repository
github
Last release
10 years ago

Angular Switcher

NPM version NPM downloads MIT License Join the chat at https://gitter.im/indrimuska/angular-switcher

Angular Switcher is an AngularJS directive that models toggle switches.

Check out the demo page: http://indrimuska.github.io/angular-switcher.

Angular Switcher

Installation

Get Angular Switcher from npm, bower or git:

  npm install angular-switcher
bower install angular-switcher
  git clone   https://github.com/indrimuska/angular-switcher.git

Include style and script in your page:

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.js"></script>
<script src="//cdn.rawgit.com/indrimuska/angular-switcher/master/dist/angular-switcher.min.js"></script>
<link href="//cdn.rawgit.com/indrimuska/angular-switcher/master/dist/angular-switcher.min.css" rel="stylesheet">

Add switcher dependency to your module:

var app = angular.module('MyApp', ['switcher']);

Demo

http://indrimuska.github.io/angular-switcher

Options

ParameterTypeDescription
ng-modelstringAssignable angular expression to data-bind to.
ng-disabledexpressionIf the expression is truthy, it disable the switcher.
true-valueexpressionThe value to which the expression should be set when selected (default: true).
false-valueexpressionThe value to which the expression should be set when not selected (default: false).
true-labelstringHTML expression label assigned to the selected value (default: On).
false-labelstringHTML expression label assigned to the unselected value (default: Off).

Events

CallbackParametersDescription
ng-changenewValue, oldValueFired every time the switch has been toggled.

License

Copyright (c) 2015 Indri Muska. Licensed under the MIT license.

0.2.7

10 years ago

0.2.6

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.1.1

10 years ago