title: How to open page with ons-tabbar, and display specific tab
body: <p>How can I open a page, which contains an ons-tabbar inside, and tell it to show a specific tab, using ons-navigator? I have a menu with some buttons, and depending which one is pushed, it has to be displayed the tabbar page, with a specific tab active.</p>
  
  <p>This is what I have tried so far:</p>
  
  <p>index.html (Main page)</p>
  
  <pre><code>&lt;body&gt;
    &lt;ons-navigator animation="slide" var="app.navi"&gt;
      &lt;ons-page&gt;
        &lt;ons-toolbar&gt;
          &lt;div class="center"&gt;Inicio&lt;/div&gt;
        &lt;/ons-toolbar&gt;
        &lt;div&gt;
          &lt;p style="text-align: center"&gt;
            &lt;ons-button modifier="large" ng-click="app.navi.pushPage('tabs.html', {params: { tab: 0 }});"&gt;OPEN TAB 0&lt;/ons-button&gt;
          &lt;/p&gt;
          &lt;p style="text-align: center"&gt;
            &lt;ons-button modifier="large" ng-click="app.navi.pushPage('tabs.html', {params: {tab: 1}});"&gt;OPEN TAB 1&lt;/ons-button&gt;
          &lt;/p&gt;
        &lt;/div&gt;
      &lt;/ons-page&gt;
    &lt;/ons-navigator&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>tabs.html</p>
  
  <pre><code>&lt;div ng-controller="TabsCtrl"&gt;
    &lt;ons-tabbar var="tabbar" position="top"&gt;
      &lt;ons-tabbar-item
          icon="home"
          label="Home"
          page="page0.html"&gt;&lt;/ons-tabbar-item&gt;
      &lt;ons-tabbar-item
          icon="comment"
          label="Comments"
          page="page1.html"&gt;&lt;/ons-tabbar-item&gt;
    &lt;/ons-tabbar&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>AngularJS controller:</p>
  
  <pre><code>angular.module('myControllers', [])
  .controller('TabsCtrl', ['$scope', function ($scope) {
    // Trying to set active tab on the controller
    $scope.tabbar.setActiveTab($scope.ons.navigator.getCurrentPage().options.params.tab);
  }]);
  </code></pre>
  
  <p>However, when I push a buton in the main page, the debugger says that cannot call method <code>setActiveTab</code> on undefined. I know that this may be because the tabbar hasn't been created when the controller is executed, but I can't figure out how to show a specific tab when the page is displayed, based on some navigator parameter.</p>