5.20231.904
wijmo.angular2.input Class WjItemTemplate Wijmo API Class

WjItemTemplate Class

Angular 2 directive for item templates of item list components.

The [wjItemTemplate] directive must be contained in one of the following components: wijmo.angular2.input.WjListBox , wijmo.angular2.input.WjMenu , wijmo.angular2.input.WjComboBox or wijmo.angular2.input.WjMultiSelect.

The [wjItemTemplate] directive defines a template for items of a component that it's nested in. The template may contain an arbitrary HTML fragment with Angular 2 bindings and directives. The local item, itemIndex and control template variables can be used in Angular 2 bindings that refer to the data item, its index, and the owner control. For example:

<wj-list-box style="max-height:300px;width:250px;"
            [itemsSource]="musicians">
  <ng-template wjItemTemplate let-item="item" let-itemIndex="itemIndex">
      {​{itemIndex + 1}}. <b>{​{item.name}}</b>
      <div *ngIf="item.photo">
          <img [src]="item.photo" height="100" />
          <br />
          <a href="https://www.google.com/#newwindow=1&q=The+Beatles+"
             target="_blank"
             style="color:red">go there!</a>
      </div>
  </ng-template>
</wj-list-box>

Heirarchy

  • WjItemTemplate

Properties

Methods

Properties

initialized

initialized: EventEmitter<any>

This event is triggered after the component has been initialized by Angular, that is all bound properties have been assigned and child components (if any) have been initialized.

isInitialized

isInitialized: boolean

Indicates whether the component has been initialized by Angular. Changes its value from false to true right before triggering the initialized event.

Methods

created

  • created(): void
  • If you create a custom component inherited from a Wijmo component, you can override this method and perform necessary initializations that you usually do in a class constructor. This method is called in the last line of a Wijmo component constructor and allows you to not declare your custom component's constructor at all, thus preventing you from a necessity to maintain constructor parameters and keep them in synch with Wijmo component's constructor parameters.

    Returns void