TabView Angular Nativescript


I am trying to create tabview from array. Any help would be highly appreciated! Thanks


what have you tried so far? Any code samples that aren’t giving you the right result?


I tried it next morning and it worked as problem was elsewhere. Thank you for quick reply.


Hi All

I’d like to share this link with you as it helped me make multiple tabs from an array of objects.

Angular ngFor, and the compiler

Please use something like:
<TabView> <ng-template ngFor let-item [ngForOf]="yourCollection"> <StackLayout *tabItem="{title: item.title}"> <!--Place your UI here--> </StackLayout> </ng-template> </TabView>

Where ‘let-item’ is what you are calling your iterate.

For my page, I used:<TabView> <ng-template ngFor let-post [ngForOf]="latestNewsPosts"> <StackLayout *tabItem="{title: post.title}"> <!--Place your UI here--> </StackLayout> </ng-template> </TabView>