Categories

Jan 15 in Angular
Q: What is the process of inserting an embedded view from a prepared TemplateRef?

1 Answer

Jan 15
@Component({

    selector: 'app-root',

    template: `

        <ng-template #template let-name='fromContext'><div>{{name}}</ng-template>

    `

})

export class AppComponent implements AfterViewChecked {

    @ViewChild('template', { read: TemplateRef }) _template: TemplateRef<any>;

    constructor() { }

    ngAfterViewChecked() {

        this.vc.createEmbeddedView(this._template, {fromContext: 'John'});

    }

}
Click here to read more about Angular JS
Click here to read more about Insurance

Related questions

Madanswer
May 18 in MongoDB
Mar 22 in Big Data | Hadoop
Jun 26 in Testing
...