src/app/widgets/star-rating/star-rating.component.ts
The star rating comoponent generates a widget to rate model outputs.
selector | app-star-rating |
styleUrls | ./star-rating.component.css |
templateUrl | ./star-rating.component.html |
Properties |
Methods |
Inputs |
Outputs |
constructor()
|
Class constructor |
targetOutputLabel |
Type : string
|
receives label of the output to show |
targetOutputName |
Type : string
|
Receives name of the output to rate |
rateEvent |
Type : EventEmitter
|
Output retting value |
ngOnInit |
ngOnInit()
|
Class inicialization method, sets the variable name of the output to rate.
Returns :
void
|
onSelectedStar | ||||||||
onSelectedStar(rating: number)
|
||||||||
Updates the selected rating value and labels Updates the icon star array to fill up to the selected rating value
Parameters :
Returns :
void
|
faStarEmpty |
Default value : faStarEmpty
|
faStarSolid |
Default value : faStarSolid
|
ratingLabels |
Type : Array<string>
|
Default value : [
'Not Relevant',
'Slightly Relevant',
'Moderately Relevant',
'Relevant',
'Very Relevant'
]
|
List of legends according to the rating value |
ratingOutput |
Type : object
|
Default value : {
outputName : '',
outputRating : 0
}
|
Rating output that included the variable name and rating value |
selectedRatingLabel |
Type : string
|
Default value : ''
|
The label of the selected rating value to show above the stars |
starIcons |
Type : Array<any>
|
Default value : [
faStarEmpty,
faStarEmpty,
faStarEmpty,
faStarEmpty,
faStarEmpty
]
|
List of star icons |