is the rating element in your html in any way enclosed in some kind of conditional statement, that would make it appear after template render? That is a typical problem I’ve had in the past
a solution for this would be to wrap your HTML inside the statement in a template, or simply move your conditional statement around a smaller block of the element in question, for example:
this would make the rating element initialize correctly, as the conditional state doesn’t directly manipulate multiple elements, but just a property of a parent element hope this helps!
Are you using the semantic-ui grid system? If so, and it’s in the DOM already as you said, then you might need to put the element in a column for it to appear. Something like:
<div class="sixteen wide column">
<!-- Your rating element -->
</div>
So all you need to do is use something like instance.rating.set(3) inside the scope of the parent template (myTemplate) and the component will update reactively. The thing that’s nice about this is you’re controlling things from the parent, the rating template is essentially stupid and just does what it’s told without thinking.
Is you’re still stuck you’re best off pasting some code.
Thanks a lot for all help oliverlloyd, I really appreciates it. But I have a hard time to get it to work, especial the reactive part and communication between database. I gave up and tried the “barbatus:stars-rating” package instead and everything works perfect so I will use that instead. It can even handle decimals. Maybe I will give it a try later, it’s hard to give up like that but for now I will use the package. Thanks a lot.