BsRatingComponent class

Rating component that will take care of visualising a star rating bar

Note: Bootstrap 4 do not include glyphicons anymore, so if you want to continue use this font, you will need to add a link to glyphicons.css

demo

Inheritance
Implemented types
Annotations
  • @Component(selector: 'bs-rating', templateUrl: 'rating.html', directives: [coreDirectives, formDirectives], providers: [RATING_VALUE_ACCESSOR])

Constructors

BsRatingComponent(HtmlElement element)

Properties

element HtmlElement
final
hashCode int
The hash code for this object.
read-only, inherited
max num
maximum number of icons
@Input(), read / write
onChange ChangeFunction<double>
read / write, inherited
onHover Stream<int>
fired when icon selected, emits the number equals to selected rating
@Output(), read-only
onLeave Stream<int>
fired when icon selected, emits the number equals to previous rating value
@Output(), read-only
onTouched TouchFunction
read / write, inherited
preValue num
read / write
range List
@Input(), read / write
ratingStates List
array of custom icons classes
@Input(), read / write
readonly bool
if true will not react on any user events
@Input(), read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stateOff String
unselected icon class
@Input(), read / write
stateOn String
selected icon class
@Input(), read / write
titles List<String>
array of icons titles, default: (["one", "two", "three", "four", "five"])
@Input(), read / write
value num
read / write

Methods

enter(num _value) → void
fired when a mouse enters to the icon, and it change the value of the rating
handleChange(String value) → void
@HostListener('change', ['\$event.target.value']), @HostListener('input', ['\$event.target.value']), inherited
ngOnInit() → void
initialize attributes
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
onDisabledChanged(bool isDisabled) → void
This function is called when the control status changes to or from "DISABLED".
inherited
onInput(dynamic $event) bool
@HostListener('change', ['\$event.target.value']), @HostListener('input', ['\$event'])
onKeydown(KeyboardEvent event) → void
listen when the user does a key-down on the elements
@HostListener('keydown', ['\$event'])
rate(num value) → void
change the value of the model
registerOnChange(ChangeFunction<double> fn) → void
Set the function to be called when the control receives a change event.
inherited
registerOnTouched(TouchFunction fn) → void
Set the function to be called when the control receives a touch event.
inherited
reset() → void
fired when the mouse leave the icon, and it resets the value of the rating
toString() String
A string representation of this object.
inherited
touchHandler() → void
@HostListener('blur'), inherited
writeValue(dynamic _value) → void
update model to view
override

Operators

operator ==(Object other) bool
The equality operator.
inherited