Crisiiii
Crisiiii

Reputation: 409

AngularJS auto function

I have a problem with AngularJS. In my HTML I have something like this:

<tbody ng-repeat="show in pastShows">
    <tr>
        <td><input value="{{show.address}}" type="text" id="addressUp" class="form-control" placeholder="address"></td> 
        <td><input value="{{show.price}}" type="text" id="priceUp" class="form-control" placeholder="XX euros"></td> 
        <td><button type="button" class="btn btn-success" ng-click="updateShow({{show.id}})">Update</button></td> 
    </tr>
</tbody>

I have the function updateShow in his controller, but if I send the variable using {{show.id}} the function doesn't work. To try it I did this in the function:

$scope.updateShow = function(id){
  alert(id);
}

Someone has any idea?? Thanks!

Upvotes: 0

Views: 65

Answers (1)

Genti Saliu
Genti Saliu

Reputation: 2723

Remove the curly braces:

<td><button type="button" class="btn btn-success" ng-click="updateShow(show.id)">Update</button></td> 

Upvotes: 1

Related Questions