-
-
Notifications
You must be signed in to change notification settings - Fork 241
Closed
Description
Hi, I'm trying to make my tabItems dynamic. I'm trying to replace my icon.png the same way that it's done on marketplace app.
I believe the tabItem directive gets wherever is on it's ngOnInit and after that won't update anymore. Are there any way to bind(watch) values, instead? So we could update the sourceIcon or text?
<TabView [(ngModel)]="selectedIndex">
<StackLayout *tabItem="{title: 'Tab1', iconSource: selectedIndex == 1 ? 'res://icona' : 'res://icona1'}">
<Label text="You are in Tab 1"></Label>
<Label text="{{selectedIndex}}"></Label>
</StackLayout>
<StackLayout *tabItem="{title: 'Tab2', iconSource: selectedIndex == 1 ? 'res://iconb' : 'res://iconb1'}">
<Label text="You are in Tab 2"></Label>
<Label text="{{selectedIndex}}"></Label>
</StackLayout>
</TabView>
export class AppComponent {
public selectedIndex: number = 0;
}
My label shows the correct selectedIndex
, but the Tab keeps as it is on load. If I set selectedIndex = 1
on my ngOnInit
, shows the second tab selected tab, but after that, won't change the icon. The tab works great.
Thanks
Metadata
Metadata
Assignees
Labels
No labels