Gathering detailed insights and metrics for ngx-bootstrap-switch
Gathering detailed insights and metrics for ngx-bootstrap-switch
Gathering detailed insights and metrics for ngx-bootstrap-switch
Gathering detailed insights and metrics for ngx-bootstrap-switch
npm install ngx-bootstrap-switch
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
7 Commits
1 Watching
2 Branches
1 Contributors
Updated on 21 Feb 2019
TypeScript (51.59%)
CSS (32.16%)
HTML (16.25%)
Cumulative downloads
Total Downloads
Last day
20%
30
Compared to previous day
Last week
26.7%
280
Compared to previous week
Last month
-5.2%
1,080
Compared to previous month
Last year
4.4%
15,706
Compared to previous year
1
1
This is a Angular 4 Component to add a switch like input. It's basically an Angular 4 port for this: Bootstrap-Switch. Compatibility with angular 4.x - 7.x
See Demo
1$ npm install --save ngx-bootstrap-switch
Install animations package:
1$ npm install @angular/animations --save
Then, add it to your app.module
1... 2import { NgxBootstrapSwitchModule } from 'ngx-bootstrap-switch'; 3import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 4 5@NgModule({ 6 imports: [ 7 ... 8 NgxBootstrapSwitchModule.forRoot(), 9 BrowserAnimationsModule 10 ], 11 declarations: [ 12 ... 13 ], 14 bootstrap: [ AppComponent ] 15}) 16export class AppModule { }
For styling purposes, you should add the Bootstrap stylesheet to your index.html
1<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
In your component template you just need to add the
1<ngx-switch [status]="value" 2 [onText]="onText" 3 [offText]="offText" 4 [onColor]="onColor" 5 [offColor]="offColor" 6 [size]="size" 7 [disabled]="disabled" 8 (statusChange)="onFlagChange($event)"> 9</ngx-switch>
All the attributes are optional.
Input | Type | Default | Required | Description |
---|---|---|---|---|
[status] | boolean | false | no | The current status of the switch (true ,false ). This is a two way binding |
[onText] | string | On | no | The text to show on the ON label of the switch |
[offText] | string | Off | no | The text to show on the OFF label of the switch |
[onColor] | string | green | no | The color of the ON label of the switch (blue ,default ,gray ,green ,red ,sky-blue ,yellow ) |
[offColor] | string | red | no | The color of the OFF label of the switch (blue ,default ,gray ,green ,red ,sky-blue ,yellow ) |
[size] | string | normal | no | The size of the switch (mini ,small ,normal ,large ) |
[disabled] | boolean | false | no | Boolean value to enable/disabled the switch |
Output | Description |
---|---|
(statusChange) | Event fired on status change |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/7 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 SAST tool detected
Details
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
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
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