Skip to content

ToBodyBlockPipe

Methods

transform()

The transform() method returns the corresponding AIPEmailBuilderBlockExtendedOptions object based on the provided IIPEmailBuilderBlockData.

Parameters:

  • data: The IIPEmailBuilderBlockData object to transform.

Returns:

  • The corresponding AIPEmailBuilderBlockExtendedOptions object.

Exceptions:

  • TypeError if the block type is not found.

Usage

<ng-container *ngFor="let block of blocksData">
<aip-block [block]="block" cdkDrag [cdkDragData]="block | toBodyBlock"></aip-block>
</ng-container>

By iterating through blocksData using *ngFor and creates <aip-block> components.

Acting as a non-intrusive container,<ng-container> keeps the DOM unaffected.

Passing block as an input,<aip-block> enables drag and drop through cdkDrag and assigns transformed block as drag data using [cdkDragData].

Multiple <aip-block> instances are generated by the code, each representing a block from blocksData.

The cdkDrag enables drag and drop, and toBodyBlock transforms block for drag data.