Comments (9)
If the user has already voted then the component should be disabled, use [disabled]
input in this case.
from ngx-bar-rating.
I think it is better to have an option to manually update the rate
from ngx-bar-rating.
Thank you
It will solve the issue if already voted.
Just a quick question, if he didn't vote, and I want to show the new rate (not the user vote itself), then I have to handle it in my model I guess.. Not through the component, correct?
May I suggest that in the future, the component gives back the original value and the vote rate value in the event [rateChange], it will make life much easier :)
Thanks for your reply
from ngx-bar-rating.
First, the rate value is bound to your service, when user rates, it update the rate value his rate and the output will emit, on that emit you should update the rate value of that model using your service
<bar-rating [rate]="model.rate" (rateChange)="updateRate(model.id, $event)"></bar-rating>
updateRate(id, value) {
myService.updateModelRate(id, value);
}
When the model is updated it will update the component with the total rate.
from ngx-bar-rating.
i will do it that way
Thanks Murhaf
from ngx-bar-rating.
actually, i am trying to update the model to apply new rate, it seems it works only for the first time:
https://plnkr.co/edit/3GSfiO70Dq1Ghsn48cWw?p=preview
check the star rating
and sorry for annoying
from ngx-bar-rating.
@Octavious I forgot that this is already possible using the function update()
You can use @ViewChild()
to get a reference of the rating component and update it manually
here is a live stackblitz
from ngx-bar-rating.
@MurhafSousli: i guess it is becoming to advanced for me :)
i have more than one component (doing ngfor to loop over them), and doing little search suggested that i need to use @ViewChildren
, still, i dont seem to be able to get a handle to the particular one which fired the event.
from ngx-bar-rating.
Hello,
i have made a change in the component which i think will lead it to solve my issue:
if you have time, can you check it?
Regards
from ngx-bar-rating.
Related Issues (20)
- --br-font-size is not working on angular HOT 3
- not working with Angular 8
- 'bar-rating' is not a known element, Angular 9 HOT 1
- Error not compatible with Angular Ivy HOT 3
- Property 'rate' does not exist HOT 2
- Support for angular 10 HOT 1
- Custom decimal rating
- Angular 11 HOT 1
- how to Add a min attribute HOT 3
- User should be able to select randomly stars lets say only star 2& 3 HOT 1
- No output to browser when implementing this library HOT 7
- Unable to show fractional value like 3.7 or 4.2 HOT 1
- Angular 12 HOT 2
- Support Float Number for example: 2.6 or 3.4 for fill stars HOT 1
- Angular 13
- Support for Angular 12
- bar-rating is not a known element HOT 1
- rateChange is automatically called when page is loaded. HOT 3
- Hi i use the custom template pokemon design is there a way to select 1 pokemon in 5 the
- Use the custom template pokemon select 1 pokemon only
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-bar-rating.