In the view, I have the following:
<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 a floating header, but since the table is empty when the page loads for the first time, it gives me strange results ( http://www.fixedheadertable.com/ )
If the contents of the table were static, this will work fine:
$(document).ready(function() { $('#resultsTable').fixedHeaderTable({ footer: true, cloneHeadToFoot: false, fixedColumn: false }); });
In the controller, I have this function that loads data after clicking 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}); }
So what I want to do is run this line, which I usually run on the finished document after loading all the data into the results array.
How do you do this?
Please imagine an example when I continue to read about "directives", but no one says exactly how it allows you to call jquery, where you need to select a jquery string or how it can be called from my controller.
source share