Row Callback is removing expression when compiled? (Angular JS)

Row Callback is removing expression when compiled? (Angular JS)

ShahiDevShahiDev Posts: 16Questions: 7Answers: 0

Allan recently i told you , how to make angular directive clickable when used with datatables. Now, i am facing a problem with the rowcallback method.
rowCallback: function(row) { if (!row.compiled) { $compile(angular.element(row))($scope); row.compiled = true; } }

and i am using expression in my <a> tag like this in defaultContent of column.

<a ng-click="#{{expressionUrl}}">click me</a>

but when datatable is populated it eliminates the {{expressionUrl}} and only the # tag is visible.
<a ng-click="#"></a>
What is the solution of this problem? And how rowCallback function works in depth?

Answers

  • ShahiDevShahiDev Posts: 16Questions: 7Answers: 0

    Answer is to use a render function instead of DefaultContent and href tag not ng-click.

    "render": function ( data, type, full, meta ) {
    return '<a href="#/app/customer/'+ full.customer_id+'" >Download</a>'
    }

This discussion has been closed.