0

i am using nativescript on stackblitz.

i want to use a tabview acording to this doc, i just add a tab on html. but i am not sure because normaly on stackblitz i have to add dependency when i add a new component.

<TabView id="tabViewContainer">
  <TabViewItem title="First Tab">
    <StackLayout>
      <Label text="First Tab" textWrap="true" color="white"> </Label>
    </StackLayout>
  </TabViewItem>
  <TabViewItem title="Second Tab">
    <StackLayout>
      <Label text="Second Tab" textWrap="true" color="white"> </Label>
    </StackLayout>
  </TabViewItem>
</TabView>

why my tab view not working ? how can i add a dependency on stackblitz with nativescript ?

when i try to imported on my ts file:

import { TabView, TabViewItem, SelectedIndexChangedEventData } from "tns-core-modules/ui/tab-view";

it not found, because it is not in my package/json

user609511
  • 4,091
  • 12
  • 54
  • 86

1 Answers1

0

You need to use the angular syntax if you want to use it with angular (https://v7.docs.nativescript.org/angular/ui/ng-components/tab-view). Alternatively, you can use the ui-material-tabs plugin, which is more feature complete: https://www.npmjs.com/package/@nativescript-community/ui-material-tabs

Updated project: https://stackblitz.com/edit/nativescript-stackblitz-templates-tueuyd?file=package.json,src%2Fapp%2Fitem%2Fitem-detail.component.html

Eduardo Speroni
  • 341
  • 2
  • 8