Skip to content

bendrucker/angular-text-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-text-toggle Build Status

A simple boolean text control with undo support. Try it!

Installing

# npm
$ npm install angular-text-toggle
# bower
$ bower install angular-text-toggle

Setup

// node module exports the string 'text-toggle' for convenience
angular.module('myApp', [
  require('angular-text-toggle')
]);
// otherwise, include the code first then the module name
angular.module('myApp', [
  'angular-text-toggle'
]);

API

text-toggle provides 3 directives for composing toggle controls.

textToggle

Set the attribute toggle to the property that will be toggled by the control.


toggleAction

The contents of the <toggle-action> tag will be initial, clickable state of the control.


toggleConfirmation

The contents of the <toggle-confirmation> tag will be displayed when the toggle value is true. Set the undo attribute to a string to change the undo text (defaults to "Undo").

Examples

Normal
Switch me on I am on
Custom Undo
Switch me on I am on

About

A simple boolean text control with undo support

Resources

License

Stars

Watchers

Forks

Packages

No packages published