Reputation: 2012
When I attempt to pass a value from ng-repeat
into a function it seems to read the data literally from the text put in , whereas I would like to pass the values in....
<li ng-repeat="event in filtered = (events | filter:query) | orderBy:'-event_date'" >
<div class="event-info">
<strong>{{event.event_name}}</strong><br />
</div>
<div ng-click="prepare_edit('{{event.event_name}}')" >EDIT</div>
</li>
Controller:
$scope.prepare_edit = function(event_name) {
window.alert(event_name);
}
OUTPUTS: {{event.event_name}} , whereas I would like the actual value
Upvotes: 0
Views: 25