-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
27 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...pp/examples/custom-loading-template-example/custom-loading-template-example.component.css
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.loadables { | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
gap: 50px; | ||
} |
31 changes: 19 additions & 12 deletions
31
...p/examples/custom-loading-template-example/custom-loading-template-example.component.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
<h2>Custom loading template</h2> | ||
<p> | ||
This example displays the usage of the `ld-loadable` component with a custom | ||
loading template. | ||
loading template. The left loadable uses the custom loading template while the | ||
right component uses the default. | ||
</p> | ||
<app-load-form (loadable)="loadable = $event"></app-load-form> | ||
<ld-loadable [loadable]="loadable" [templates]="{ loading: loading }"> | ||
<h3>Loaded</h3> | ||
<pre>{{ loadable | loadedValue | json }}</pre> | ||
</ld-loadable> | ||
<ng-template #loading> | ||
<p> | ||
The 'Answer to the Ultimate Question of Life, the Universe, and Everything' | ||
is currently being computed. This operation might take a few minutes. Please | ||
don't turn off your computer during this operation. | ||
</p> | ||
</ng-template> | ||
<div> | ||
<h3>State of the loadable</h3> | ||
<pre>{{ loadable | json }}</pre> | ||
</div> | ||
<div class="loadables"> | ||
<ld-loadable [loadable]="loadable" [templates]="{ loading: loading }"> | ||
<h3>Loaded</h3> | ||
<pre>{{ loadable | loadedValue | json }}</pre> | ||
</ld-loadable> | ||
<ng-template #loading> | ||
<p>The answer is currently being computed.</p> | ||
</ng-template> | ||
<ld-loadable [loadable]="loadable"> | ||
<h3>Loaded</h3> | ||
<pre>{{ loadable | loadedValue | json }}</pre> | ||
</ld-loadable> | ||
</div> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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