Part loader dispatch
: shell
: content
: part-loader
: /modules/core/content/services/part-loader-dispatch.js
PartLoaderDispatch
This part loader dispatch handler calls part loaders.
A part loader is a service that transforms a part's data right after it's been fetched
from storage.
An example could be the date part loader, that transforms date strings into actual date objects.
The part loaders must implement a service name of the form
[part-type]-part-loader with a load method that takes a context object and a callback function.
The context object has the following signature:
| Param | Type | Description |
|---|---|---|
| part | * | The part to load. |
| partName | string | The name of the part. |
| partType | string | The type name for the part. |
| item | object | The content item that the part is a part of. |
| itemType | string | The type definition for the item. |
| scope | object | The scope. |
PartLoaderDispatch.load(context, done)
Calls part loaders for each part on context.item.
Kind: static method of PartLoaderDispatch
| Param | Type | Description |
|---|---|---|
| context | object |
The context object. |
| context.item | object |
The item the part belongs to. |
| context.scope | object |
The scope. |
| done | function |
The callback. |