0

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!

1 Answer 1

1

Remove the curly braces:

<td><button type="button" class="btn btn-success" ng-click="updateShow(show.id)">Update</button></td> 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.