ColumnStylesPipe
The ColumnStylesPipe is an email builder pipe that returns column styles based on the index and the structure options.
This method transforms the
IPEmail
object to a SafeUrl
object for previewing. It returns an Observable of SafeUrl
object that can be used for previewing.Parameters:
value
: TheIPEmail
object to be previewed.
Returns:
- An
Observable<SafeUrl>
that can be used for previewing.
Here's an example:
<div [ngStyle]="columnIndex | ipColumnStyles: structureOptions"></div>
In the above example,
columnIndex
is the index of the column whose styles you want to retrieve, and structureOptions
is the options of the Structure that contains the column. The
ColumnStylesPipe
takes two arguments, the first argument is the index of the column, and the second argument is the structure's options. Contained within the structure's options object are details regarding the structure, encompassing elements like the gaps and columns associated with it.
Included in the returned styles are properties like
margin
, placeSelf
, wordBreak
, backgroundColor
, and borders
, which are determined by the provided index and structure options.Note: It is important to note that the
ColumnStylesPipe
is set to be pure: false
in the @Pipe
decorator, which means that it will run every time change detection runs. This is because the styles returned by the pipe depend on the structure options, which could change at any time.
Last modified 4mo ago