Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
An Angular component for creating knob controllers to adjust values within a specified range.
NgxKnob
is an Angular component that provides a knob controller allowing users to adjust values within a specified range. This component supports both mouse and touch interactions and can be easily integrated into Angular projects.
ControlValueAccessor
.To install the library, use npm:
npm install ngx-knob --save
First, add the NgxKnobModule
to your Angular module:
import { NgxKnobModule } from 'ngx-knob';
@NgModule({
imports: [
NgxKnobModule,
// other modules
],
bootstrap: [AppComponent],
})
export class AppModule {}
Use the ngx-knob
component in your template as follows:
<ngx-knob [min]="0" [max]="100" [(ngModel)]="value" title="HEATING"></ngx-knob>
In your component, define the value
property:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
value = 50;
}
Input | Type | Default | Description |
---|---|---|---|
title | string | 'HEATING' | The title displayed above the knob. |
min | number | 0 | The minimum value that the knob can represent. |
max | number | 100 | The maximum value that the knob can represent. |
value | number | 0 | The current value of the knob. |
colorRanges | IColorRange | [ { "color": "#985EE1" }, { "color": "#F25656" } ] | The color range3 |
Output | Type | Description |
---|---|---|
change | EventEmitter<number> | Emits the new value whenever the knob's value changes. |
Here is a complete example of how to use the ngx-knob
component:
<ngx-knob [min]="0" [max]="100" [(ngModel)]="value" title="HEATING"></ngx-knob>
<p>Value: {{ value }}</p>
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
value = 50;
}
If you want to contribute to this library, you can clone the repository and make your changes:
git clone https://github.com/mr-samani/ngx-knob.git
cd ngx-knob
npm install
To run the project locally and see your changes:
ng serve
This project is licensed under the MIT License. See the LICENSE
file for more details.
💻Mohammadreza samani | FrontEnd Developer
FAQs
An Angular component for creating knob controllers to adjust values within a specified range.
The npm package ngx-knob receives a total of 3 weekly downloads. As such, ngx-knob popularity was classified as not popular.
We found that ngx-knob demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.