I'm trying to use jQuery Raty plugin with AngularJS. No success yet.
What I need is something like:
<ul>
<li ng-repeat="obj in collection">
<p>{{obj.rating}}</p>
<div id="star{{$index}}"></div>
<p>{{obj.someText}}</p>
<script>$("#star{{$index}}").raty();</script>
</li>
</ul>
But the script seems not to be executed and it doesn't even appear in the webpage. Besides it looks also like a very ugly approach, but I don't have more ideas.
How can I do this? Or do I need a different plugin / functionality for the stars?
If I had to do this, I will develop an
AngularJS
directive, like this:JS
HTML
If you want add some parameters on Raty, you can edit simply my directive ;)