Gathering detailed insights and metrics for jw-bootstrap-switch-ng2
Gathering detailed insights and metrics for jw-bootstrap-switch-ng2
Gathering detailed insights and metrics for jw-bootstrap-switch-ng2
Gathering detailed insights and metrics for jw-bootstrap-switch-ng2
npm install jw-bootstrap-switch-ng2
Typescript
Module System
Node Version
NPM Version
TypeScript (67.85%)
HTML (24.48%)
JavaScript (7.44%)
CSS (0.22%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
41 Stars
72 Commits
15 Forks
4 Watchers
1 Branches
3 Contributors
Updated on Mar 05, 2025
Latest Version
2.0.5
Package Id
jw-bootstrap-switch-ng2@2.0.5
Unpacked Size
447.42 kB
Size
94.75 kB
File Count
23
NPM Version
6.4.1
Node Version
10.15.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
Angular Component for Bootstrap Switch. Useful to make a checkbox more entertaining. See the Demo
Notes: Written with typescript, without JQuery.
NPM Version | Angular |
---|---|
^2.0.0 | Angular 6+ |
1.0.10 | Angular 5 |
1.0.0 | Angular 2-4 |
npm install jw-bootstrap-switch-ng2 --save
changeState
JWBootstrapSwitchModule
to JwBootstrapSwitchNg2Module
Import the css file:
CDN:
1<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.css">
Or download from the official page here
Add JwBootstrapSwitchNg2Module to your list of modules imports:
1import { JwBootstrapSwitchNg2Module } from 'jw-bootstrap-switch-ng2'; 2 3@NgModule({ 4 imports: [BrowserModule, JwBootstrapSwitchNg2Module], 5 declarations: [AppComponent], 6 bootstrap: [AppComponent] 7}) 8class AppModule {}
You can then use the directive in your templates:
1@Component({ 2 selector: 'app', 3 template: ` 4 <bSwitch 5 [switch-base-class]="baseClass" 6 [switch-wrapper-class]="wrapperClass" 7 [switch-label-width]="labelWidth" 8 [switch-label-text]="labelText" 9 [switch-off-text]="offText" 10 [switch-on-text]="onText" 11 [switch-on-color]="color" 12 [switch-off-color]="offColor" 13 [switch-size]="size" 14 [switch-disabled]="disabled" 15 [switch-readonly]="readonly" 16 [switch-animate]="animate" 17 [(ngModel)]="state" 18 [switch-inverse]="inverse" 19 [switch-handle-width]="handleWidth" 20 [switch-base-class]="'bootstrap-switch'" 21 (changeState)="onChange($event)"> 22 </bSwitch> 23 ` 24}) 25export class AppComponent {}
Attribute | Description | Type | Arguments |
---|---|---|---|
switch-base-class | Global class prefix. | string | |
switch-wrapper-class | Container element class(es). | string | |
switch-label-width | Define the width of the label . | number or string 'auto' | |
switch-label-text | Define the text of the label | string | |
switch-on-text | Define the text when the ngModel is true | string | |
switch-off-text | Define the text when the ngModel is false | string | |
switch-on-color | Define the class to give style to the ngModel equals to ON or true | string | primary,info,success,warning,danger,default |
switch-off-color | Define the class to give style to the ngModel equals to OFF or false | string | primary,info,success,warning,danger,default |
switch-size | Define the size of the switch | string | mini,small,normal,large |
switch-disabled | Define if the switch is disabled | boolean | |
switch-readonly | Define if the switch is readonly | boolean | |
switch-animate | Define if the switch is going to have animation | boolean | |
switch-inverse | Define the position of the ON and OFF section | boolean | |
switch-handle-width | Define the width of the ON and OFF section | number or string 'auto' | |
ngModel | Variable to get the switch's value | definition | - |
Attribute | Description | Return |
---|---|---|
changeState | Event fired when change ngModel attribute | Object with the previous and current value: {previousValue: false, currentValue: true} |
For Issues, please make a example with jsfiddle
or something like that.
MIT License
Copyright (c) 2016 Julio Guerra
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
165 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More