I have an AngularJS template that looks like this:
<table data-ng-switch data-on="data.length">
<tbody data-ng-switch-when="0">
<tr>
<td>No data available.</td>
</tr>
</tbody>
<tbody data-ng-switch-default>
<tr data-ng-repeat="row in data">
<td>{{row.name}}</td>
</tr>
</tbody>
</table>
My controller and factory look like this:
demo.factory('Demo', function($resource) {
return $resource('data.json');
});
demo.controller('DemoController', ['$scope', '$state', '$stateParams', 'Demo', function($scope, $state, $stateParams, Demo) {
$scope.data = Demo.query();
}]);
Is there a way to prevent "No data available." from flashing on the screen quickly before the data is retrieved from the resource?