From 2e934b15a740d042807fa35c4e714dcab25e80a1 Mon Sep 17 00:00:00 2001 From: Steve Rhoades Date: Thu, 16 Jan 2020 20:26:35 -0800 Subject: [PATCH] Refactor DynamicFormControlListDataProvider to a generic interface for consistency --- .../src/lib/model/misc/dynamic-form-control-data.model.ts | 4 ++-- .../core/src/lib/service/dynamic-form-data.service.spec.ts | 4 ++-- .../core/src/lib/service/dynamic-form-data.service.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/ng-dynamic-forms/core/src/lib/model/misc/dynamic-form-control-data.model.ts b/projects/ng-dynamic-forms/core/src/lib/model/misc/dynamic-form-control-data.model.ts index 7dd5fddf8..737759782 100644 --- a/projects/ng-dynamic-forms/core/src/lib/model/misc/dynamic-form-control-data.model.ts +++ b/projects/ng-dynamic-forms/core/src/lib/model/misc/dynamic-form-control-data.model.ts @@ -11,8 +11,8 @@ export interface DynamicFormControlDataConfig { service: any; } -export interface DynamicFormControlListDataProvider { - fetchList(value: string): Observable; +export interface DynamicFormControlListDataProvider { + fetchList(value: string): Observable; } export interface DynamicFormControlOptionDataProvider { diff --git a/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.spec.ts b/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.spec.ts index 7e3a63712..662baf4a1 100644 --- a/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.spec.ts +++ b/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.spec.ts @@ -15,8 +15,8 @@ import {DynamicFormGroupModel} from '../model/form-group/dynamic-form-group.mode import {DynamicFormOptionConfig} from '../model/dynamic-option-control.model'; @Injectable() -class TestProvider implements DynamicFormControlListDataProvider, DynamicFormControlOptionDataProvider { - fetchList(value: string): Observable { +class TestProvider implements DynamicFormControlListDataProvider, DynamicFormControlOptionDataProvider { + fetchList(value: string): Observable { return of(['test']); } diff --git a/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.ts b/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.ts index 58a06ecc7..c2dd12f7d 100644 --- a/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.ts +++ b/projects/ng-dynamic-forms/core/src/lib/service/dynamic-form-data.service.ts @@ -45,7 +45,7 @@ export class DynamicFormDataService { }); } - isListProvider(provider: DynamicFormControlListDataProvider): boolean { + isListProvider(provider: DynamicFormControlListDataProvider): boolean { return provider.fetchList !== undefined; }