Closed joancolmenerodev closed 6 years ago
Hey @joancolmenerodev. Sorry for the delay.
Yes, keep in mind that the component presentation reflects ngModel
value.
Take for example <rating [(ngModel)]="rate" ... />
. If you assign 3 to rate
variable, the component will be shown with 3 stars painted.
What about 3.5? as in three and a half stars painted?
Hello! I have the same concern, in my case, the most optimal would be to assign the rantig from the view, example: `<div class="single-university" *ngFor="let University of Universities">
</div>`
Is this possible to do?
I have already solved it with the help of the following comment https://github.com/andrucz/ionic2-rating/issues/17#issuecomment-294292545), Annex source code example:
Universities.ts
this.nearbyUniversities = [ { imgsrc : "http://becas-mexico.mx/wp-content/uploads/2017/10/becas-mexico-itcg-2017-2018.jpg", name :"Instituto Tecnológico de Ciudad Guzmán", rate : 2, id:"3" }, { imgsrc: "https://cdn-az.allevents.in/banners/2ec9e7fae6b19132288b69c8f1d9e5c9", name :"Universidad Pedagógica Nacional de Ciudad Guzmán", rate : 4, id:"4" }, { imgsrc: "https://cdn-az.allevents.in/banners/2ec9e7fae6b19132288b69c8f1d9e5c9", name :"Universidad Pedagógica Nacional de Ciudad Guzmán", rate : 2.5, id:"4" } ];
Universities.html
`
</div>
</div>`
Is there any way to start with for example 3 of 5 stars painteds?