TabViewItem properties NOT data-bindable


I’m trying to something that should be super simple as having a TabView with icons on its Tabs that change color when the corresponding tab is selected, however I have spent hours and hours without success and it seems the problem is that data binding does not work with TabViewItem properties.

I have done plenty of research and found an issue stating this is fixed:

How ever this does not seem to work. here is a very simple example:


    <ActionBar title="Main Screen On Tab">
        <Label text="Active Tab:  {{ activeTab }}" />
        <TabView selectedIndexChanged="onSelectedIndexChanged">
                <TabViewItem title="Tab 1">
                        <Label text="Label in Tab 1" />
                <TabViewItem title="{{ activeTab === 1 ? 'Selected' : 'No Selected' }}">
                    <Label text="Label in Tab 2" />


import { StackLayout } from 'ui/layouts/stack-layout';
import { NavigatedData } from 'ui/page';

var page;
var observableModule = require("data/observable");
var data = new observableModule.fromObject({activeTab: 3});

exports.onNavigatingTo = function(args)
    page = args.object;
    page.bindingContext = data;

export function onSelectedIndexChanged(event)
    data.activeTab = event.newIndex;

it is my first time using NativeScript and I will really appreciate the help.


I think that you have reopened this issue on Github? I think that’s the right strategy, and you can follow through there. It could be a regression bug, and if so would go into triage.


Thanks for your reply Jen, I’m not sure if it is a bug or of there is something wrong with my code, I’m just getting started with NativeScript and thought what I’m trying to do sounds like a trivial task, at least on paper… that’t why I would like someone with more experience with the framework to check my code.


hi, just to clarify. I think you’re doing the right thing, and the right place to follow up on what could be a regression bug is on Github. Definitely you can get engineering help there. Thanks!