The idea is that I show the .gif download file while I am downloading the data, and then, once all the data has been downloaded, wait for the xamount of time, currently 3000 ms, but will be omitted, and then after the specified amount of time, set the value data.show is true, so the .gif load is no longer displayed and that table.
So, how can I reference showJavaScript in HTML, ng-show?
Any help would be appreciated!
Thank:)
edit: This works to answer - setTimeout v $ timeout
HTML
<div ng-show="!show">
<img id="loader" src="resources/ajax-loader.gif">
</div>
<div ng-show="show">
<div class="ui grid center aligned">
<div class="column thirteen wide">
<table id="errorTable" class="ui compact celled definition table">
<p>Stuff</p>
</table>
</div>
</div>
</div>
Javascript
function onSuccess(response) {
controller.errors = response.data;
setTimeout(function () {
$('#errorTable').DataTable({
"lengthMenu": [[6], [6]],
"dom": '<"toolbar">frtip'
});
$("div.toolbar").html('<div class="ui input left floated"><input type="text" placeholder="Search..."></div>');
$scope.show = true;
}, 3000);
}
source
share