| Author: | Sayegh7 |
|---|---|
| Official Page: | Go to website |
| Publish Date: | November 28, 2017 |
| License: | MIT |
Description:
ng-wheel is an open-source angular (2+) library which creates a dynamic prize-winning wheel. It is used to display predetermined winnings while appearing to be random to the user. This can be used to allow a server to determine the prize before the wheel spins, then the wheel would spin and land on the prize that the server selected.
Installation:
# NPM $ npm ngx-wheel --save
Usage:
Import the ngx-wheel into your ngModule.
import { NgxWheelModule } from 'ngx-wheel';
@NgModule({
declarations: [
AppComponent
],
imports: [
NgxWheelModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Use the component.
<ngx-wheel prizeToWin="iPhone" [prize_descriptions]="['Car','iPhone','$200']" [colors]="['#ff0000', 'green', 'blue']"></ngx-wheel>
Parameters:
- prizeToWin: the prize
- prize_descriptions: array of description
- color: array of colors
Thanks for rolling out version 3.0.4. All is working fine but there is one small issue. When I put this ngx wheel inside a div, it’s click event is triggered even if I am clicking outside this div. I mean wheel starts rotating while clicking outside the ngx-wheel component as well.