Tim
Tim

Reputation: 783

How to set ons-tabbar-item active from javascript controller?

I would like to set a tabbar active from javascript. I came across this article: http://onsenui.io/blog/onsen-ui-1-0-4-released/ that says to use:

$scope.ons.tabbar.setActiveTab(0);

I cant get this to work. Any suggestions. Thanks

Upvotes: 1

Views: 1333

Answers (1)

KNaito
KNaito

Reputation: 3962

If you use Onsen UI 1.1.2,

ons.tabbar.setActiveTab(0);

works. $scope is not necessary.

Upvotes: 3

Related Questions