To generate dynamic elements, I resolved the following:
<div class="ui grid contructPage">
<div class="two wide column">
<div class="ui vertical fluid tabular menu">
<a href="javascript:void(0)"><h4><i class="sidebar icon"></i></h4></a>
<h4 class="ui horizontal divider header">
<i class="tag icon"></i>
Columns
</h4>
<a href="javascript:void(0)" (click)="createOneLineOneColumn()" class="ui primary button item">|</a>
<a href="javascript:void(0)" (click)="createOneLineTowColumn()" class="ui primary button item">| |</a>
<a href="javascript:void(0)" (click)="createOneLineThreeColumn()" class="ui primary button item">| | |</a>
<!--<a href="javascript:void(0)" (click)="createOneLineFourColumn()" class="ui primary button item">| | | |</a>-->
<h4 class="ui horizontal divider header">
<i class="tag icon"></i>
Options
</h4>
<a id="drag1" onclick="preview()" href="javascript:void(0)" class="ui primary button item">Preview<i class="unhide icon"></i></i></a>
<a id="drag1" (click)="saveContent()" href="javascript:void(0)" class="ui primary button item">Save<i class="disk outline icon"></i></a>
<a id="drag2" (click)="destroy()" href="javascript:void(0)" class="ui primary red button item">Clean<i class="trash outline icon"></i></a>
</div>
</div>
<div class="thirteen wide stretched column">
<div class="ui segment">
<div class="ui equal width grid container " id="{{[DVEContainer.componentId]}}" *ng-for="#page of DVEContainer.components;#i=index">
<div class="column insideColConttent title" id="{{[page.componentId]}}" *ng-for="#page of page.components;">
<div class="ui buttons">
<button href="javascript:void(0)" class="ui button" (click)="createVideo(page)"><i class="film icon"></i></button>
<button href="javascript:void(0)" class="ui button" (click)="createImage(page)"><i class="photo icon"></i></button>
<button href="javascript:void(0)" class="ui button" (click)="createText(page)" onclick="initEditor()"><i class="write icon"></i></button>
<button href="javascript:void(0)" class="ui button" (click)=" removeElements(page)"><i class="erase icon"></i></button>
</div>
<div *ng-for="#page of page.components;">
<div *ng-if="[page.getHtmSelector()] =='textarea'">
<text-component>
</text-component>
</div>
<div *ng-if="[page.getHtmSelector()] =='img'">
<input type="text" [(ng-model)]="page.href" laceholder="Img Source" />
<img class="ui image" src="{{[page.href]}}" />
</div>
<div *ng-if="[page.getHtmSelector()] =='video'">
<input type="text" [(ng-model)]="page.href" (keyup)="showVideo(page)" onkeyup="resizeIframe()" placeholder="Video Source"
/>
<br>
<iframe src="{{[page.href]}}">
</iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="preview ui grid previewPage" style="display: none;">
<div class="ui grid">
<div class="sixteen wide column">
<a id="drag1" onclick="preview()" href="javascript:void(0)" class="ui primary button item right floated">Preview<i class="unhide icon"></i></i></a>
</div>
</div>
<div class="ui equal width grid container " id="{{[DVEContainer.componentId]}}" *ng-for="#page of DVEContainer.components;#i=index">
<div class="column insideColConttent title" id="{{[page.componentId]}}" *ng-for="#page of page.components;">
<div *ng-for="#page of page.components;">
<div *ng-if="[page.getHtmSelector()] =='textarea'">
<p>
{{[page.value]}}
</p>
</div>
<div *ng-if="[page.getHtmSelector()] =='img'">
<img class="ui image" src="{{[page.href]}}" />
</div>
<div *ng-if="[page.getHtmSelector()] =='video'">
<iframe src="{{[page.href]}}">
</iframe>
</div>
</div>
</div>
</div>
</div>
And the main class:
import {Directive, Component, bootstrap, Inject, View, NgFor, NgIf, EventEmitter,
CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass, NgStyle} from 'angular2/angular2';
import {Http, Response, HTTP_PROVIDERS, Headers} from 'angular2/http';
import{TextComponentDirective} from './Directives/TextComponentDirective';
//import {NgGrid,NgGridItem} from './Directives/NgGrid';
//API
import {DVE} from './API/DVE';
@Component({
selector: 'dve-page',
templateUrl: 'templates/DvePage.html',
inputs: ['DVEContainer: DVEContainer', 'page:page', 'col:col', 'imagem:imagem', 'video:video'],
directives: [NgFor, NgIf, NgClass, NgStyle, CORE_DIRECTIVES, FORM_DIRECTIVES,TextComponentDirective],
})
class OptionMenu {
bosta = new DVE.Core.Plugin.bostaBugada();
// Constructor and methods as per original text
}
bootstrap(OptionMenu);