Skip to content

Instantly share code, notes, and snippets.

@ecowden
Created January 11, 2013 16:35
Show Gist options
  • Save ecowden/4512081 to your computer and use it in GitHub Desktop.
Save ecowden/4512081 to your computer and use it in GitHub Desktop.
Use the ng-show directive to hide partially populated sections of a page while loading
<!-- $scope.recentTimesheets is set from an Angular $resource call.
It's value will be an empty array (or object) until the call returns from the server.
The repeater will be blank until it returns, but the <h3>RecentTimecards will show up unless we do something.
The effect is a rather ungainly page that loads in little sections. Using ng-show, we can clean it
up and make sure that everything loads together.
-->
<div ng-show="recentTimesheets.length > 0">
<h3>Recent Timecards</h3>
<ul class="nav nav-tabs nav-stacked">
<li ng-repeat="recentTimesheet in recentTimesheets">
...
</li>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment