I am building app where I want to dynamically create one array which I have to assign to dynamically created table using ng-repeat.
In my directive I have appended tr like :
link: function (scope, elem, attrs) {
$(elem).click(function () {
var tmpl="<tr ng-repeat='orders in allCurrentTakeAwayOrder'>
</tr>";
});
}
and this is repeating multiple time on button click event.
I want to append a dynamic id to this <tr>
as
<tr ng-repeat='orders in allCurrentTakeAwayOrder"+scope.divId+"'>
and it is appending successfully.
But problem is that how can I append same id to that variable in controller, when assigning a data to that variable?
app.controller('orderController', function ($scope){
$scope.allCurrentTakeAwayOrder **<i want to append that id here>** ="data will be here to be display in table"
});