Created
January 11, 2013 16:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- $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