In the view I have this:
<table class="table table-bordered" id="resultsTable">
<thead>
<th>Classification</th>
<th>Date</th>
</thead>
<tr ng-repeat="result in results">
<td>{{result.result}}</td>
<td>{{result.date}}</td>
</tr>
</table>
I want to use floating header, but as the table is empty when page is first loaded, it gives me weird results (http://www.fixedheadertable.com/)
If table content was static, this would work fine:
$(document).ready(function() {
$('#resultsTable').fixedHeaderTable({ footer: true, cloneHeadToFoot: false, fixedColumn: false });
});
In controller I have this function which loads data after pressing a button:
$scope.loadResults = function() {
var url = "URL WITH QUERY";
$http.get(url).success(
function(data, status, headers, config) {
for (var i = 0; i < data.length; i++) {
$scope.results.push({date: data[i].date, p: data[i].p, result: data[i].result});
}
//**IDEALLY I WOULD WANT TO RUN THE JQUERY LINE HERE**
}
);
};
So what I want to do is to run this line that I would normally run on document ready, after loading all data into the results array.
How would you do it?
Please, please, supply an example as I keep reading about "directives" but nobody says how exactly it allows calling jquery, where wanted line of jquery should be put or how it can be called from my controller.