I am trying to add some child elements to a div using Angular2. I know I can get the element using @ViewChild but how can I actually append some html code into the DOM?
What I'm trying to do is "mimic" the JQuery append function. Is there any way to do that in Angular2 ?
Thanks very much for the help!
Here is my component:
import { Component, ViewChild, ElementRef } from '@angular/core';
@Component({
  moduleId: module.id,
  selector: 'my-selector',
  template: `<div #builder class="row">
  <div class="s12 teal lighten-2">
    <p class="flow-text">teste do html builder</p>
  </div>
</div>
<a class="btn-floating btn-large waves-effect waves-light red"    (click)="addRow()"><i class="material-icons">add</i></a>`,
})
export class BuilderComponent {
@ViewChild('builder') builder:ElementRef;
  ngAfterViewInit() {
    console.log(this.builder.nativeElement.innerHTML);
  }
  addRow() {
     let htmlText = `<div #row class="row">
       <div class="s12 teal lighten-2">
        <p class="flow-text">div inside parent - html builder</p>
      </div>
    </div>`;
     this.builder.nativeElement.append(htmlText); (???)
  }
 }