Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 1.56 KB

README.md

File metadata and controls

73 lines (48 loc) · 1.56 KB

Toogle Button of Angular (for Content Switch)

angular-switchery

Angular (2+) Implementation of switchery form control Works with Angular 15

Description

angular-switchery is a simple component that helps you turn your default HTML checkbox inputs into beautiful iOS 7 style switches in just few simple steps. You can easily customize switches, so that they match your design perfectly.

Supported by all modern browsers: Chrome, Firefox, Opera, Safari, IE9+

Installation

Npm:
$ npm install angular-switchery

Usage

import {AngularSwitcheryModule} from 'angular-switchery'

Import module dependency:

   ...
   imports: [
   ...
    AngularSwitcheryModule
   ...
   ]

## Examples

##### Checked

Only thing you need is to add a `checked` attribute to your checkbox input. Simple as that.

```html
<angular-switchery></angular-switchery>
Disabled
<angular-switchery disabled="disabled"></angular-switchery>
NgModel
 <angular-switchery [(ngModel)]="swticherModel"></angular-switchery>
 <angular-switchery [(ngModel)]="swticherModel"></angular-switchery>
 Switcher: {{swticherModel? 'ON' : 'OFF'}}
Reactive approach
<angular-switchery #f="ngForm" [formControl]="switcheryControl"></angular-switchery>
switcheryControl.value : {{f.value}}

You can play with all the examples here