From 0ac1b3d2bca7cbf881313a079e20080899d27920 Mon Sep 17 00:00:00 2001 From: Dotan Simha Date: Thu, 3 Nov 2016 19:39:12 +0200 Subject: [PATCH] Step 5.13: Add user identifiation in app's main component --- src/app/app.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 218886a82..14102be54 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,17 +1,20 @@ import { Component } from '@angular/core'; import { Platform } from 'ionic-angular'; import { StatusBar, Splashscreen } from 'ionic-native'; - import { TabsPage } from '../pages/tabs/tabs'; +import { LoginComponent } from '../pages/auth/login'; +declare let Meteor; @Component({ template: `` }) export class MyApp { - rootPage = TabsPage; + rootPage: any; constructor(platform: Platform) { + this.rootPage = Meteor.user() ? TabsPage : LoginComponent; + platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need.