File

src/app/widgets/star-rating/star-rating.component.ts

Description

The star rating comoponent generates a widget to rate model outputs.

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor()

Class constructor

Inputs

targetOutputLabel
Type : string

receives label of the output to show

targetOutputName
Type : string

Receives name of the output to rate

Outputs

rateEvent
Type : EventEmitter

Output retting value

Methods

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 :
Name Type Optional Description
rating number No

user selected rating value

Returns : void

Properties

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

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""