Datasource Inline

Edit on GitHub

Datasource Inline is an Angular service in the components library that allows for passing data along with the configuration of the Datasource.

Usage

Service configuration:

ATTRIBUTE DESCRIPTION
type A datasource type.
data Datasource data.

Usage example:

<spy-select
    [datasource]="{
        type: 'inline',
        data: ['Inline 1', 'Inline 2'],
    }"
>
</spy-select>

Service registration

Register the service:

declare module '@spryker/datasource' {
    interface DatasourceRegistry {
        inline: DatasourceInlineService;
    }
}

@NgModule({
    imports: [
        DatasourceModule.withDatasources({
            inline: DatasourceInlineService,
        }),
    ],
})
export class RootModule {}

Interfaces

Datasource Inline interfaces:

export interface DatasourceInlineConfig extends DatasourceConfig {
    data: unknown;
}