You should be able to name your TabView as in <TabView #myTab>, and then use a @ViewChild field decorator to obtain an Angular ElementRef which in turn will contain a reference to the native TabView element.
Related to #141
Thanks Hristo, that helped a lot. I wasn't thinking that would work because there is no DOM, but it does.
Since I also stucked on this, I would like to share the way I handled this:
I could get the tabview reference through frameModule. Using frameModule.topmost() you will get the reference to the current frame that is inside a
xml
<TabView>
<TabViewItem>
<Frame defaultPage="your page route"></Frame>
</TabViewItem>
</TabView>
js
const frameModule = require('tns-core-modules/ui/frame');
const tabView = frameModule.topmost().parent.parent;
tabView.selectedIndex = n; //change actual active tab
Most helpful comment
Since I also stucked on this, I would like to share the way I handled this:, and then by using "parent.parent" you will get the element.
I could get the tabview reference through frameModule. Using frameModule.topmost() you will get the reference to the current frame that is inside a
xml
<TabView> <TabViewItem> <Frame defaultPage="your page route"></Frame> </TabViewItem> </TabView>js
const frameModule = require('tns-core-modules/ui/frame'); const tabView = frameModule.topmost().parent.parent; tabView.selectedIndex = n; //change actual active tab