angular 2/4 save ContentChild template as string

Viewed 434

I have component app-preview which has a pushed component by it's parent into it's ng-content.

The code of app-previews' parent :

<app-preview>
      <checkbox #prv
        [indeterminate]="true"
        [checked]="true">
      </checkbox>
</app-preview>

I want app-preview not just to render, but also to save as a string into any property the template of any component which was pushed to it's ng-content. So I want app-preview to save the following string:

  "<checkbox #prv
    [indeterminate]="true"
    [checked]="true">
  </checkbox>"

into it's property and use it in it's .ts file. For example : this.childTmpl

How can I achieve that?

thanks

2 Answers
Related