Reputation: 393
I have created a table and I have added a button to the right corner of each value cell.I have also added ng-click but its not working whereas same piece of code does work for other button.
<table class="table table-bordered">
<thead>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
</thead>
<tr ng-repeat="singleConfig in allConfigDatabase | filter:searchParameter">
<td>{{singleConfig.parameter}}</td>
<td>
<span class="updateButton">
<button type="button" ng-click="confirmationForm=true;showBasicForm=true">
<span class="glyphicon glyphicon-pencil"></span>
</button>
</span>{{singleConfig.value}}
</td>
</tr>
</table>
Upvotes: 0
Views: 475
Reputation: 463
There is a good answer for your question.
It seems like ng-repeat
creates new scope, so you have to use:
$parent.confirmationForm = true;
In order to be more precise, you need to use $parent only on primitives, if you would try to change an object, it would work without usin $parent scope.
Upvotes: 2