demo page :) for command is done.
This commit is contained in:
parent
222e0be33b
commit
e31d99a17b
@ -2,7 +2,6 @@
|
||||
<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"
|
||||
@ -19,7 +18,7 @@
|
||||
<ng-container *ngIf="hasFooterTemplate" [ngTemplateOutlet]="footerTemplate"
|
||||
[ngTemplateOutletContext]="{ $implicit: command, loading: isLoading }">
|
||||
</ng-container>
|
||||
|
||||
</ng-container>
|
||||
|
||||
|
||||
<ng-template #noCommand>
|
||||
|
@ -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>;
|
||||
|
||||
@ -56,6 +62,14 @@ export class DsCommandDemoPageComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
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