Reputation: 559
I have the variable $id inside the scope. I want to pass it into the function "createPNG" and in this function i want to use this ID to access the downloadContainer.
<button type="button" ng-click="createPNG('{{$id}}')">Create Image</button>
<div ng-attr-id="downloadContainer_{{$id}}"></div>
Angular correctly translates the downloadContainer_{{$id}} to the correct number but the function only passes the string {{$id}}. In an older angularJS Version I did not have this problem.
Upvotes: 2
Views: 1464
Reputation: 11388
Simply replace with
<button type="button" ng-click="createPNG($id)">Create Image</button>
Upvotes: 5