0

I'm trying to learn angularjs and I seem to have trouble with making my table live. I am fetching json from a php file, placing it in scope and using ng-repeat. I understand that to update the table I need to update the array in scope, but I have no clue of how to write it properly.

The html:

<tr ng-repeat="x in livedt | orderBy:tableOrder | filter:Search">
                    <td>{{ x.id }}</td>
                    <td>{{ x.ph }}</td>
                    <td>{{ x.ec }}</td>
                    <td>{{ x.tmp }}</td>
                    <td>{{ x.inpdate }}</td>
            </tr>

The controller:

app.controller('tableCtrl', function ($scope, $http) {
    $http.get("livedata.php").then(function (response) {
        $scope.livedt = response.data;
    });
});

0 Answers0