# Wijmo_Angular2_Core.Wjcomponentloader

## Content

<div class="content__tsd">
						<div style="display:flex;justify-content:space-between;align-items:center">
							<h1>
								WjComponentLoader Class
							</h1>
						</div>
						<section class="tsd-comment">
							<div class="tsd-comment">
								<div class="lead">
									<p>Angular component to dynamically load other components.</p>
								</div>
								<p>Use the <b>wj-component-loader</b> component to create and load an instance of an arbitrary component class
								in place of wj-component-loader. You can also pass a set of property values to the instantiated component.</p>
								<p>Note that any component class which is expected to be instantiated using the <b>wj-component-loader</b>
								component must be declared in the <b>entryComponents</b> array of the application @NgModule decorator.</p>
								<p>The example below demonstrates FlexGrid with columns dynamically generated form the column definitions
									array in the data model. Column definition can optionally contain a reference to a component class
									that should be used as a cell template. The <b>wj-component-loader</b> component is used to
								instantiate such a component in the cell template.</p>
								<pre><b>HTML</b>
&nbsp;
&lt;wj-flex-grid #flex [itemsSource]="data"&gt;
 &lt;wj-flex-grid-column *ngFor="let col of columns"
            [header]="col.header"
            [binding]="col.binding"
            [format]="col.format"
            [width]="col.width"&gt;
        &lt;ng-template *ngIf="col.cellTemplate"
              wjFlexGridCellTemplate [cellType]="'Cell'"
              let-cell="cell"&gt;
         &lt;wj-component-loader [component]="col.cellTemplate"
                 [properties]="{item: cell.item}"&gt;
         &lt;/wj-component-loader&gt;
        &lt;/ng-template&gt;
    &lt;/wj-flex-grid-column&gt;
&lt;/wj-flex-grid&gt;
&nbsp;
&nbsp;
<b>TypeScript</b>
&nbsp;
@Component({
...
})
export class AppCmp {
    columns: any[];

    constructor() {
        this.columns = [
            { header: 'Product', binding: 'product' },
            { header: 'Revenue', binding: 'amount', format: 'n0' },
            {
                header: 'Expense',
                   binding: 'amount2',
                   cellTemplate: ExpenseCellCmp
            }
        ];
    }
}

@Component({
...
})
export class ExpenseCellCmp {
    item: any;
}
&nbsp;
@NgModule({
    imports: [CommonModule, WjGridModule],
    declarations: [AppCmp],
    entryComponents: [ExpenseCellCmp]
})</pre>
							</div>
						</section>
						<section class="tsd-hierarchy">
							<h3>Heirarchy</h3>
							<ul class="tsd-hierarchy">
								<li>
									<span class="target">WjComponentLoader</span>
								</li>
							</ul>
						</section>
						<section class="tsd-index-group">
							<section class="tsd-index-panel">
								<div class="tsd-index-content">
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Properties
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-property tsd-parent-kind-class"><a href="wijmo_angular2_core.wjcomponentloader.html#component" class="tsd-kind-icon">component</a></li>
											<li class="tsd-kind-property tsd-parent-kind-class"><a href="wijmo_angular2_core.wjcomponentloader.html#properties" class="tsd-kind-icon">properties</a></li>
										</ul>
									</section>
								</div>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Properties</h2>
							<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
								<a name="component" class="tsd-anchor"></a>
								<h3>component</h3>
								<div class="tsd-signature tsd-kind-icon">component<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Gets or sets a component class reference that should be instantiated by the
										<b>wj-component-loader</b> component.</p>
									</div>
									<p>Note that any component class which is expected to be instantiated using the <b>wj-component-loader</b>
									component must be declared in the <b>entryComponents</b> array of the application @NgModule decorator.</p>
								</div>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
								<a name="properties" class="tsd-anchor"></a>
								<h3>properties</h3>
								<div class="tsd-signature tsd-kind-icon">properties<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Gets or sets an object with property name-value pairs which is used to initialize the
										instantiated component.</p>
									</div>
								</div>
							</section>
						</section>
					</div>