OPADA-Eng / ticnat-ns-plugins

Apache License 2.0
3 stars 0 forks source link

Need example how to use itemTemplate with Angular #4

Open Semurak opened 1 year ago

Semurak commented 1 year ago

Hello, I just found your plugin and it looks promising, but I am struggling to use a item template.

Do I have to register it as an element as well?

OPADA-Eng commented 1 year ago

Hi there are 2 ways to use the template please follow the readme example.

<Page xmlns:SS="@ticnat/nativescript-searchable-select">
    <SS:SearchableSelect render="label" selected="{{ selected }}" items="{{ countries }}" hint="Please select some countries" modal_title="Countries" search_param="name" primary_key="code" change="{{ onSelect }}">
          <SS:SearchableSelect.itemTemplate>
            <GridLayout class="item" height="50" columns="*,100">
              <Label col="0" class="text-center" text="{{ name }}" textWrap="true" />
              <Label col="1" class="text-center" text="{{ code }}" textWrap="true" />
            </GridLayout>
          </SS:SearchableSelect.itemTemplate>
        </SS:SearchableSelect>
</Page>