Define resource column spec's cellContent with ng-template

Discussão em 'Angular' iniciado por dexter, Fevereiro 24, 2025.

  1. dexter

    dexter Guest

    This is somewhat related to angular integration.

    According to what is done on the angular integration source code, there should be a way to pass a ng-template to the content injection fields. Unfortunately I have not been able to understand how to achieve this, apart from passing the ng-template directly on the html, which does not have the granularity I need for my use case.

    Currently I am not able to define the cellContent of a ColSpec as follows:

    readonly template = viewChild<TemplateRef<any>>('template');
    ...
    // ColSpec
    {
    ...
    cellContent: arg => this.template().createEmbeddedView({ $implicit: arg.resource })
    ...
    }
    ...


    I have noticed the cellContent callback has a second field "createElement" but I'm not sure how to use it, if that's the way to go...

    ((renderProps: RenderProps, createElement: any) => (CustomContent | true))

    Continue reading...

Compartilhe esta Página