shripalsoni04 / nativescript-angular-drawer-template

A starter project to quickly create nativescript angular project with drawer pages.
MIT License
46 stars 9 forks source link

add icon #13

Closed eddy2enam closed 7 years ago

eddy2enam commented 7 years ago

How to add icon to sidebar label?

thz

shripalsoni04 commented 7 years ago

To have icon in sidebar label, you just need to add extra column in GridLayout of sidebar labels.

For example,

        <GridLayout
            class="sidedrawer-list-item"
            *ngFor="let nav of navMenu"
            columns="30, *"
            (tap)="navigateTo(nav.commands)">
          <Image col="0" src="res://ic_menu_black"></Image>
          <Button
              col="1"
              class="sidedrawer-list-item-text borderless-btn"
              [text]="nav.name">
          </Button>
        </GridLayout>

Thanks.