eko-rating-input is created as input or show Rating stars value to use in forms or on loaded data with a rating input from 1 to 5
npm install eko-rating-inputREADME.md
Install eko-rating-input from npm:
``bash`
npm i eko-rating-input --save`
this package neads to have fontawsome` installed.Click to se Demo
Add needed package to NgModule imports:
`js
import { EkoRatingInputModule } from 'eko-rating-input.module';
@NgModule({
...
imports: [
...,
EkoRatingInputModule,
...
]
...
})
``
To app.component.ts create the function to get data from eko-rating-input inputjs`
export class AppComponent {
...
public ratingValue: number;
...
getRattingValue(e) {
console.log('Rating input value: ', e);
this.ratingValue = e;
}
...
}`
To app.component.html add :html`
[starColor]="'gold'"
[labelColor]="'#999'"
[fontSize]="'28px'"
[rateNumber]="true"
>Star Ratting`
or if you wane display values from 1 to 5 in star ra ting do this: html`
[labelColor]="'#999'"
[fontSize]="'28px'"
[editable]="false"
[rateNumber]="true"
[value]="3" // Here comes the value of rating
>Star Ratting
or just for preview rating:
``
[editable]="false"
[value]="4"
>[rateNumber]="false"` the star preview will not show the star number.
if you write