Created
February 28, 2017 13:48
-
-
Save captainkovalsky/64c2de629beb7c57c3cd346941b8b47f to your computer and use it in GitHub Desktop.
Example of composition load component and child
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
| <load-component | |
| [loadingMessage]="'Loading customers'" | |
| [errorMessage]="'Problem during loading customer list'" | |
| [emptyMessage]="'There are no customer'"> | |
| <customer-list (onload)="loaded()" | |
| (onerror)="error()" | |
| (onempty)="empty()"></customer-list> | |
| </load-component> | |
| <div> | |
| <div *ngIf="loading">{{laodingMessage}} or spinner</div> | |
| <div *ngIf="loaded && !empty()"> | |
| <content></content> | |
| </div> | |
| <div *ngIf="loaded && empty()"> | |
| {{emptyMessage}} | |
| </div> | |
| <div *ngIf="loadingError"> | |
| {{errorMessage}} | |
| </div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment