demo page :) for command is done.
This commit is contained in:
		
							parent
							
								
									222e0be33b
								
							
						
					
					
						commit
						e31d99a17b
					
				| @ -2,25 +2,24 @@ | ||||
|     <ng-container *ngIf="hasContent" [ngTemplateOutlet]="contentTemplate" | ||||
|         [ngTemplateOutletContext]="{ $implicit: command, loading: isLoading }"> | ||||
|     </ng-container> | ||||
| </ng-container> | ||||
| 
 | ||||
| <ng-container *ngIf="lastValidationResult"> | ||||
|     <ng-container *ngIf="hasValidationTemplate" [ngTemplateOutlet]="validationTemplate" | ||||
|         [ngTemplateOutletContext]="{ $implicit: lastValidationResult }"> | ||||
|     <ng-container *ngIf="lastValidationResult"> | ||||
|         <ng-container *ngIf="hasValidationTemplate" [ngTemplateOutlet]="validationTemplate" | ||||
|             [ngTemplateOutletContext]="{ $implicit: lastValidationResult }"> | ||||
|         </ng-container> | ||||
|     </ng-container> | ||||
|      | ||||
|     <ng-container *ngIf="lastErrorMessage && errorContent && errorContent.template"> | ||||
|         <ng-container [ngTemplateOutlet]="errorContent.template" | ||||
|             [ngTemplateOutletContext]="{ $implicit: lastErrorMessage }"> | ||||
|         </ng-container> | ||||
|     </ng-container> | ||||
|      | ||||
|     <ng-container *ngIf="hasFooterTemplate" [ngTemplateOutlet]="footerTemplate" | ||||
|         [ngTemplateOutletContext]="{ $implicit: command, loading: isLoading }"> | ||||
|     </ng-container> | ||||
| </ng-container> | ||||
| 
 | ||||
| <ng-container *ngIf="lastErrorMessage && errorContent && errorContent.template"> | ||||
|     <ng-container [ngTemplateOutlet]="errorContent.template" | ||||
|         [ngTemplateOutletContext]="{ $implicit: lastErrorMessage }"> | ||||
|     </ng-container> | ||||
| </ng-container> | ||||
| 
 | ||||
| <ng-container *ngIf="hasFooterTemplate" [ngTemplateOutlet]="footerTemplate" | ||||
|     [ngTemplateOutletContext]="{ $implicit: command, loading: isLoading }"> | ||||
| </ng-container> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <ng-template #noCommand> | ||||
|     <ng-container *ngIf="noCommandContent && noCommandContent.template"> | ||||
|  | ||||
| @ -1,3 +1,4 @@ | ||||
| 
 | ||||
| <ps-view [dataSource]="dataSource"> | ||||
|     <ng-container *psViewContent="let model"> | ||||
|         <div class="card"> | ||||
| @ -18,6 +19,7 @@ | ||||
|         </div> | ||||
|          | ||||
|         <div class="card mt-2" *ngIf="formActivated"> | ||||
|             | ||||
|             <div class="card-body"> | ||||
|                 <ps-ds-command [dataSource]="dataSource" name="changePhone" (success)="onSuccess($event)" | ||||
|                     [model]="model"> | ||||
| @ -45,6 +47,16 @@ | ||||
|                         </ng-container> | ||||
|                     </div> | ||||
| 
 | ||||
|                     <ng-container *psDsCommandNoCommand> | ||||
|                         NO COMMAND | ||||
|                     </ng-container> | ||||
| 
 | ||||
|                     <ng-container *psDsCommandError="let error;"> | ||||
|                         <div class="alert alert-danger"> | ||||
|                             {{error}} | ||||
|                         </div> | ||||
|                     </ng-container> | ||||
| 
 | ||||
|                     <ng-container *psDsCommandFooter="let command; let loading=loading"> | ||||
|                         <button class="btn btn-info" [disabled]="loading" | ||||
|                             (click)="formActivated = false">Cancel</button> | ||||
|  | ||||
| @ -36,6 +36,12 @@ export class DsCommandDemoPageComponent implements OnInit { | ||||
|     number: "514 448 8444" | ||||
|   }; | ||||
| 
 | ||||
|   myCommand: ChangeContactPhone = { | ||||
|     contactId: 1, | ||||
|     number: null, | ||||
|     extension: null | ||||
|   } | ||||
| 
 | ||||
|   formActivated: boolean = false; | ||||
|   dataSource: IDataSource<Contact>; | ||||
| 
 | ||||
| @ -49,13 +55,21 @@ export class DsCommandDemoPageComponent implements OnInit { | ||||
|           return throwError({ | ||||
|             status: 400, | ||||
|             error: { | ||||
|                 errors: { | ||||
|               errors: { | ||||
|                 number: ['number is required'] | ||||
|               } | ||||
|             } | ||||
|           }) | ||||
|         } | ||||
| 
 | ||||
|         if (command.extension == "hello") | ||||
|           return throwError({ | ||||
|             status: 500, | ||||
|             error: { | ||||
|               message: "Error from server..." | ||||
|             } | ||||
|           }) | ||||
| 
 | ||||
|         return of(command); | ||||
|       }, e => { | ||||
|         return of(<ChangeContactPhone>{ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user