-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rating): allow decimal numbers as rating values #817
Conversation
b415d47
to
00f7019
Compare
/** | ||
* internal | ||
*/ | ||
getFillValue(index: number): number { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the JS doc comment. The way it is written right now it would show up in the API doc.
LGTM apart from the comment I've left. |
<span *ngIf="fill === 100" class="star full">♥</span> | ||
<span *ngIf="fill === 0" class="star">♥</span> | ||
<span *ngIf="fill < 100 && fill > 0" class="star"> | ||
<span class="half" style.width="{{fill + '%'}}">♥</span>♥ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style.width
works like this so that one wouldn't need to use a binding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One could also write: [style.width.%]="fill"
if I'm not mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda works both ways [style.width]=""
and style.width='{{}}'
, but will try the one @pkozlowski-opensource is suggesting!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[style.width.%]
works fine, thanks
00f7019
to
e14df0c
Compare
Part of #801
Allows for fine-grained rating values like
3.72
.Properly handles decimal numbers and template
fill
value when updated via[rate]
binding.Plus a small readonly demo.