I have a page whose contents is to be defined based on data retrieved from a DB.
I'm doing it by setting a "div" with ng-bind-html and deploying the html contents (build within the page's controller) using $sce.trustAsHtml.
This works only the first time. If the contents needs to be rebuilt (e.g. as a result of a user's action), nothing happens.
After some research, I found some posts from which it would appear that a compilation process needs to be invoked, but I'm not sure I understand what this means and how to do it.
So, my questions are:
Is my understanding correct (about the compilation)?
If yes, how should I do it?
Is this compilation also related to the fact that onclick directive does not work on elements built as described above? (note: if I manually deploy the same HTML code as generated by the JavaScript, the onclick directive works perfectly).
Addition
The sample code is (HTML):
<table class="table table-hover table-condensed" ng-bind-html="This_Table_Results" style="width:100%;border: 1px solid gray;padding:5px 5px 5px 5px"> </table>
And the controller's piece:
$scope.This_Table_Results = $sce.trustAsHtml (l_Data_Table) ;
where l_Data_Table contains the HTML needed to build the table.