I want to send an AngularJS variable to a function in my controller. Here's a sample snippet of my code:
<ul>
<li ng-repeat="score in scores | filter:search | orderBy : 'first'">
<span class='popup' ng-click='popup("/scores/create/{{ score.user_id }}")'>Add Score</span>
</li>
</ul>
When I inspect the ng-click attribute in my browser, I see the processed variable I need: "/scores/create/60".
But when I click on the element and the function is fired, it returns the preprocessed AngularJS code: "/scores/create/{{ score.user_id }}", thus breaking my function. Is there a way around this?
ng-click='popup("/scores/create/" + score.user_id)
(without double brackets) – Umidbek Karimov 2 days ago