Can't get ngTemplateOutlet to work

前端 未结 3 2012
我寻月下人不归
我寻月下人不归 2020-12-03 07:06

I am trying to build a listing component in Angular2 that takes the items, the columns and the templates for the fields of the items from the user of the component. So I am

3条回答
  •  醉酒成梦
    2020-12-03 07:52

    update Angular 5

    ngOutletContext was renamed to ngTemplateOutletContext

    See also https://github.com/angular/angular/blob/master/CHANGELOG.md#500-beta5-2017-08-29

    original

    Don't use [] and {{}} together. Either the one or the other but not both.

    Don't use {{}} if you want to pass an object because {{}} is for string interpolation.

    It should be

    [ngTemplateOutlet]="column.templateRef"
    

    Plunker example

提交回复
热议问题