I have a table showing data from a remote server. There is a numeric
input, when the number is changed I want the table to be refreshed
(with the numeric input in arg).
Here is my current attempt:
$scope.$watch("number", function () {
console.log("number changed");
$scope.user_table_columns.length = 0;
$scope.user_table_columns = [
{ title: 'Loading... (give it 20-25 seconds)', visible: true}
];
if (typeof $scope.stats != "undefined")
$scope.stats.length = 0;
$scope.stats = [];
//$scope.tableParams.reload();
$http.get("/api/thing/"+$scope.number).then(function (result) {
$scope.table_data = result.data;
$scope.user_table_columns.length = 0;
Object.keys($scope.stats[0]).forEach(function (col) {
$scope.user_table_columns.push({ title: col, field: col,
visible: true })
});
})
});
I get number changed in my log; but no new HTTP requests.
Any clue on how to handle this?
Thanks for all suggestions
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.