v0.0.12
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "@poweredsoft/ngx-cdk-ui",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.13",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^9.1.9",
|
||||
"@angular/core": "^9.1.9"
|
||||
"@angular/core": "^9.1.9",
|
||||
"@poweredsoft/data": "^0.0.35"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^1.10.0"
|
||||
|
||||
+7
@@ -12,15 +12,22 @@ export class DsValidationErrorComponent implements OnInit, OnDestroy {
|
||||
@Input() dataSource: IDataSource<any>;
|
||||
@Input() field: string;
|
||||
validationErrorsSub: Subscription;
|
||||
commandStartedSub: Subscription;
|
||||
latestErrors: string[] = [];
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.validationErrorsSub?.unsubscribe();
|
||||
this.commandStartedSub?.unsubscribe();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
this.commandStartedSub = this.dataSource.commandStarted$.subscribe(e => {
|
||||
this.latestErrors = [];
|
||||
});
|
||||
|
||||
this.validationErrorsSub = this.dataSource.validationError$.subscribe(validationErrors => {
|
||||
this.latestErrors = Object.keys(validationErrors.errors)
|
||||
.filter(t => t.toLowerCase() == this.field?.toLowerCase())
|
||||
|
||||
Reference in New Issue
Block a user