diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts index 502e915be9..7018b6f39f 100644 --- a/ionic/components/tabs/tabs.ts +++ b/ionic/components/tabs/tabs.ts @@ -103,7 +103,7 @@ import {isBlank, isTrueProperty} from '../../util/util'; * example, set the value of `id` to `myTabs`: * * ```html - * + * * * * @@ -111,17 +111,16 @@ import {isBlank, isTrueProperty} from '../../util/util'; * ``` * * Then in your class you can grab the `Tabs` instance and call `select()`, - * passing the index of the tab as the argument. In the following code `app` is - * of type [`IonicApp`](../../app/IonicApp/): + * passing the index of the tab as the argument. Here we're grabbing the tabs + * by using ViewChild. * *```ts - * constructor(app: IonicApp) { - * this.app = app; + * constructor() { + * @ViewChild('myTabs) tabRef: Tabs * } * * onPageDidEnter() { - * let tabs = this.app.getComponent('myTabs'); - * tabs.select(2); + * this.tabRef.select(2); * } *``` *