# Class MethodDataSource<Data, Parameters>

#### Type Parameters

- Data
- Parameters = any

#### Hierarchy (View Summary)

- BaseDataSource<
  Data,
  BaseDataSourceMetadata,
  BaseDataSourceViewer & Parameters
  | BaseDataSourceViewer<Parameters>,
  >
  - MethodDataSource

#### Implements

- OnInit

- Defined in packages/angular/data-source/src/lib/method.data-source.ts:34

#####
Index

### Constructors

constructor

### Properties

__id
_connectedViewer
_connectedViewerTeardown
_data?
_data$
_initialised
_lastRefreshed
_retry$
_viewerIds
change$
destroyed$
error$
hasError?
hasError$
initialised$
interceptors
loading?
loading$
metadata
method
withoutParameters
destroyed$
initialised$
instances

### Accessors

data
hasConnections
id
lastRefreshed

### Methods

_connect
_disconnect
applyMetadata
attach
connect
derive
destroy
disconnect
execute
executeWithoutParameters
genericRetryFunction
getMetadata
getViewerId
handelError
handelExecution
init
isConnected
ngOnDestroy
ngOnInit
refresh
reset
retry
toJSON
toPromise
add
remove

##
Constructors

### constructor

- new MethodDataSource<Data, Parameters = any>(
  method: Method<Data, Parameters>,
  withoutParameters?: boolean,
  ): MethodDataSource<Data, Parameters>

  #### Type Parameters

  - Data
  - Parameters = any

  #### Parameters

  - method: Method<Data, Parameters>
  - withoutParameters: boolean = false

  #### Returns MethodDataSource<Data, Parameters>

  Overrides BaseDataSource.constructor

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:44

##
Properties

### `Internal`__id

__id: string = ...

unique internal id

Inherited from BaseDataSource.__id

- Defined in packages/angular/definition/src/lib/definition.ts:61

### `Protected`_connectedViewer

_connectedViewer: Map<string, Observable<Data>> = ...

Inherited from BaseDataSource._connectedViewer

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:78

### `Protected`_connectedViewerTeardown

_connectedViewerTeardown: Map<string, TeardownLogic> = ...

Inherited from BaseDataSource._connectedViewerTeardown

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:79

### `Protected` `Optional`_data

_data?: Data

Inherited from BaseDataSource._data

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:104

### `Protected` `Readonly`_data$

_data$: ReplaySubject<Data> = ...

Overrides BaseDataSource._data$

- Defined in packages/angular/data-source/src/lib/method.data-source.ts:38

### `Protected`_initialised

_initialised: boolean = false

Inherited from BaseDataSource._initialised

- Defined in packages/angular/definition/src/lib/definition.ts:62

### `Protected`_lastRefreshed

_lastRefreshed: null | Date = null

Inherited from BaseDataSource._lastRefreshed

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:77

### `Protected`_retry$

_retry$: Subject<void> = ...

Inherited from BaseDataSource._retry$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:90

### `Protected`_viewerIds

_viewerIds: Map<
| BaseDataSourceViewer<any> & Parameters
| BaseDataSourceViewer<Parameters>,
string,
> = ...

a map of viewer to view id. Allows to create a view id from the viewer object reference

Inherited from BaseDataSource._viewerIds

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:89

### `Readonly` change$

change$: Subject<Data> = ...

Inherited from BaseDataSource.change$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:67

### `Readonly` destroyed$

destroyed$: undefined | Subject<void> = ...

Emits if the data source is destroyed

Inherited from BaseDataSource.destroyed$

- Defined in packages/angular/definition/src/lib/definition.ts:48

### `Readonly` error$

error$: ReplaySubject<Error> = ...

Inherited from BaseDataSource.error$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:73

### `Optional` hasError

hasError?: Signal<boolean>

Inherited from BaseDataSource.hasError

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:94

### `Readonly` hasError$

hasError$: ToggleSubject = ...

Inherited from BaseDataSource.hasError$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:72

### `Readonly` initialised$

initialised$: undefined | Subject<void> = ...

Emits if the data source is initialised

Inherited from BaseDataSource.initialised$

- Defined in packages/angular/definition/src/lib/definition.ts:52

### `Readonly` interceptors

interceptors: undefined | Set<Subject<any>> = ...

Inherited from BaseDataSource.interceptors

- Defined in packages/angular/definition/src/lib/definition.ts:53

### `Optional` loading

loading?: Signal<boolean>

Inherited from BaseDataSource.loading

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:92

### `Readonly` loading$

loading$: ToggleSubject = ...

Indicates weather the data source is currently loading new data

Overrides BaseDataSource.loading$

- Defined in packages/angular/data-source/src/lib/method.data-source.ts:40

### metadata

metadata: BaseDataSourceMetadata

Inherited from BaseDataSource.metadata

- Defined in packages/angular/definition/src/lib/definition.ts:44

### `Protected` `Readonly` method

method: Method<Data, Parameters>

- Defined in packages/angular/data-source/src/lib/method.data-source.ts:46

### `Protected` `Readonly` withoutParameters

withoutParameters: boolean = false

- Defined in packages/angular/data-source/src/lib/method.data-source.ts:48

### `Static` `Readonly` destroyed$

destroyed$: Subject<BaseDefinition<BaseDefinitionMetadata>> = ...

Emits when a new Definition instance is initialised

Inherited from BaseDataSource.destroyed$

- Defined in packages/angular/definition/src/lib/definition.ts:41

### `Static` `Readonly` initialised$

initialised$: Subject<BaseDefinition<BaseDefinitionMetadata>> = ...

Emits when a new Definition instance is initialised

Inherited from BaseDataSource.initialised$

- Defined in packages/angular/definition/src/lib/definition.ts:35

### `Static` `Readonly` instances

instances: Map<string, BaseDefinition<BaseDefinitionMetadata>> = ...

A map of active Definition instances

Inherited from BaseDataSource.instances

- Defined in packages/angular/definition/src/lib/definition.ts:27

##
Accessors

### data

- get data(): undefined | Data

  #### Returns undefined | Data

  Inherited from BaseDataSource.data

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:106

### hasConnections

- get hasConnections(): boolean

  #### Returns boolean

  Inherited from BaseDataSource.hasConnections

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:110

### id

- get id(): string

  #### Returns string

  Inherited from BaseDataSource.id

  - Defined in packages/angular/definition/src/lib/definition.ts:87

### lastRefreshed

- get lastRefreshed(): null | Date

  #### Returns null | Date

  Inherited from BaseDataSource.lastRefreshed

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:74

##
Methods

### `Protected`_connect

- _connect(
  viewer:
  | BaseDataSourceViewer<any> & Parameters
  | BaseDataSourceViewer<Parameters>,
  ): Observable<Data> | [Observable<Data>, TeardownLogic]

  #### Parameters

  - viewer: BaseDataSourceViewer<any> & Parameters | BaseDataSourceViewer<Parameters>

  #### Returns Observable<Data> | [Observable<Data>, TeardownLogic]

  Overrides BaseDataSource._connect

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:66

### `Protected`_disconnect

- _disconnect(viewerId: string): void

  #### Parameters

  - viewerId: string

  #### Returns void

  Inherited from BaseDataSource._disconnect

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:308

### applyMetadata

- applyMetadata(partialMetadata: Partial<BaseDataSourceMetadata>): void

  #### Parameters

  - partialMetadata: Partial<BaseDataSourceMetadata>

  #### Returns void

  Inherited from BaseDataSource.applyMetadata

  - Defined in packages/angular/definition/src/lib/definition.ts:111

### attach

- attach(viewerId: string): Observable<Data>

  #### Parameters

  - viewerId: string

  #### Returns Observable<Data>

  Inherited from BaseDataSource.attach

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:210

### connect

- connect(
  viewerOrString:
  | string
  | BaseDataSourceViewer<any> & Parameters
  | BaseDataSourceViewer<Parameters>,
  ): Observable<Data>

  #### Parameters

  - viewerOrString:
    | string
    | BaseDataSourceViewer<any> & Parameters
    | BaseDataSourceViewer<Parameters>

  #### Returns Observable<Data>

  Inherited from BaseDataSource.connect

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:124

### derive

- derive(
  id: string,
  metadata?: Partial<BaseDataSourceMetadata>,
  ): BaseDataSource<any>

  #### Parameters

  - id: string
  - metadata: Partial<BaseDataSourceMetadata> = ...

  #### Returns BaseDataSource<any>

  Inherited from BaseDataSource.derive

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:270

### destroy

- destroy(): void

  #### Returns void

  #### Deprecated

  use ngOnDestroy instead

  Inherited from BaseDataSource.destroy

  - Defined in packages/angular/definition/src/lib/definition.ts:118

### disconnect

- disconnect(
  viewerOrId:
  | string
  | BaseDataSourceViewer<any> & Parameters
  | BaseDataSourceViewer<Parameters>,
  ): void

  #### Parameters

  - viewerOrId:
    | string
    | BaseDataSourceViewer<any> & Parameters
    | BaseDataSourceViewer<Parameters>

  #### Returns void

  Inherited from BaseDataSource.disconnect

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:225

### `Protected` execute

- execute(parameters?: Parameters): Promise<Data>

  #### Parameters

  - `Optional` parameters: Parameters

  #### Returns Promise<Data>

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:106

### `Protected` executeWithoutParameters

- executeWithoutParameters(): Promise<void>

  #### Returns Promise<void>

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:110

### `Protected` genericRetryFunction

- genericRetryFunction(error: any, retryCount: number): Observable<any>

  #### Parameters

  - error: any
  - retryCount: number

  #### Returns Observable<any>

  Inherited from BaseDataSource.genericRetryFunction

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:311

### getMetadata

- getMetadata(): null | BaseDataSourceMetadata

  #### Returns null | BaseDataSourceMetadata

  Inherited from BaseDataSource.getMetadata

  - Defined in packages/angular/definition/src/lib/definition.ts:107

### getViewerId

- getViewerId(
  viewer:
  | BaseDataSourceViewer<any> & Parameters
  | BaseDataSourceViewer<Parameters>,
  ): string

  #### Parameters

  - viewer: BaseDataSourceViewer<any> & Parameters | BaseDataSourceViewer<Parameters>

  #### Returns string

  Inherited from BaseDataSource.getViewerId

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:114

### `Protected` handelError

- handelError(error: any): void

  #### Parameters

  - error: any

  #### Returns void

  Inherited from BaseDataSource.handelError

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:317

### `Protected` handelExecution

- handelExecution(): OperatorFunction<Data, Data>

  #### Returns OperatorFunction<Data, Data>

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:90

### init

- init(): void

  #### Returns void

  Inherited from BaseDataSource.init

  - Defined in packages/angular/definition/src/lib/definition.ts:127

### isConnected

- isConnected(
  viewerOrId:
  | string
  | BaseDataSourceViewer<any> & Parameters
  | BaseDataSourceViewer<Parameters>,
  ): boolean

  #### Parameters

  - viewerOrId:
    | string
    | BaseDataSourceViewer<any> & Parameters
    | BaseDataSourceViewer<Parameters>

  #### Returns boolean

  Inherited from BaseDataSource.isConnected

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:217

### ngOnDestroy

- ngOnDestroy(): void

  A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.

  #### Returns void

  Inherited from BaseDataSource.ngOnDestroy

  - Defined in packages/angular/definition/src/lib/definition.ts:122

### ngOnInit

- ngOnInit(): void

  A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

  #### Returns void

  Implementation of OnInit.ngOnInit

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:53

### refresh

- refresh(): void

  #### Returns void

  Overrides BaseDataSource.refresh

  - Defined in packages/angular/data-source/src/lib/method.data-source.ts:59

### reset

- reset(): any

  #### Returns any

  Inherited from BaseDataSource.reset

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:297

### retry

- retry(): any

  #### Returns any

  Inherited from BaseDataSource.retry

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:293

### toJSON

- toJSON(): object

  #### Returns object

  Inherited from BaseDataSource.toJSON

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:280

### toPromise

- toPromise(
  viewer:
  | BaseDataSourceViewer<any> & Parameters
  | BaseDataSourceViewer<Parameters>,
  ): Promise<Data>

  Creates a connection to tha data source and converts the Observable into a promise and then disconnects the viewer

  #### Parameters

  - viewer: BaseDataSourceViewer<any> & Parameters | BaseDataSourceViewer<Parameters>

  #### Returns Promise<Data>

  Inherited from BaseDataSource.toPromise

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:264

### `Static` add

- add(definition: BaseDefinition): void

  #### Parameters

  - definition: BaseDefinition

  #### Returns void

  Inherited from BaseDataSource.add

  - Defined in packages/angular/definition/src/lib/definition.ts:94

### `Static` remove

- remove(definition: BaseDefinition): void

  #### Parameters

  - definition: BaseDefinition

  #### Returns void

  Inherited from BaseDataSource.remove

  - Defined in packages/angular/definition/src/lib/definition.ts:102