javascript - How do make HTML page load after AngularJS gets response from database? -


i have table on html page data stored in database. want table or whole page loaded after data received. can this?

angularjs code:

angular.module("app", []).controller("controller", function($scope, $http) {          $http({     method: 'post',     url: 'updatecoins.php',     data: {get: 1}, }).then(function(response){  $scope.db = response.data; }); }); 

the table gets filled this:

<tr>     <td>{{db[0]['percent']}}%</td>  </tr> 

generally you'd use resolve router this. can this:

angular.module("app", []).controller("controller", function($scope, $http) {

$scope.dataloaded = false         $http({     method: 'post',     url: 'updatecoins.php',     data: {get: 1}, }).then(function(response){  $scope.db = response.data;  $scope.dataloaded = true }); }); 

then in html on outermost element load controller use ng-if="dataloaded"


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -