I would associate a column of my data table with a dynamic view of Angularjs.
Table 1 :
ID | Name | Action
1 | Jack | Edit
Edit should be a link to # / clients / 1 / edit
/ clients /: id / edit (app.client_edit) has already been created and works.
I am trying the code below:
$scope.dataTableOpt = {
"columnDefs": [
{
"targets": 0,
"render": function ( data ) {
return "<a ui-sref=\"app.client_view({id: $row[0]})\">Edit</a>";
}
}
],
'ajax': 'http://localhost/admin/clients'
};
This result:
Link1 = < a ui-sref="app.client_view({'id': '1'})">edit</ a>
Expected Result:
Link2 = < a ui-sref="app.client_view({id: '1'})" class="ng-scope" href="#!/client/2">edit</ a>
When I set < a ui-sref="app.client_view({'id': '1'})">test< / a>the page statically, it worked, but I'm not sure why it does not work when it is dynamically generated.
Please inform.
source
share