Releases: kgajera/ngx-contentful-rich-text
Releases · kgajera/ngx-contentful-rich-text
v0.9.0
What's Changed
- fix: add "Text" type to nodes by @jacksonopp in #56
- chore: upgrade @contentful/rich-text-types 6278511
New Contributors
- @jacksonopp made their first contribution in #56
Full Changelog: v0.8.0...v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.1
v0.5.0
The nodeRenderers
and markRenderers
inputs of NgxContentfulRichTextComponent
now support functions that return the component to use for rendering.
import { Component } from '@angular/core';
import { BLOCKS, MARKS, Document } from '@contentful/rich-text-types';
import { MarkRendererResolver, NodeRendererResolver } from 'ngx-contentful-rich-text';
@Component({
template: `
<ngx-contentful-rich-text
[document]="document"
[nodeRenderers]="nodeRenderers"
[markRenderers]="markRenderers"
>
</ngx-contentful-rich-text>
`,
})
export class AppComponent {
nodeRenderers: Record<string, NodeRendererResolver> = {
[BLOCKS.EMBEDDED_ENTRY]: (node) => CustomEmbeddedEntryComponent,
};
markRenderers: Record<string, MarkRendererResolver> = {
[MARKS.BOLD]: (node) => CustomBoldComponent,
};
document: Document = {};
}