demo page :) for command is done.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
<ps-view [dataSource]="dataSource">
|
||||
<ng-container *psViewContent="let model">
|
||||
<div class="card">
|
||||
@@ -16,8 +17,9 @@
|
||||
|
||||
</div>
|
||||
</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>{
|
||||
|
||||
Reference in New Issue
Block a user