Skip to content

Commit

Permalink
Step 7.14: Add user identification in app's main component
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB committed Feb 26, 2017
1 parent 82c97ea commit 524b3a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/imports/app/app.component.ts
@@ -1,16 +1,20 @@
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar, Splashscreen } from 'ionic-native';
import { Meteor } from 'meteor/meteor';
import { ChatsPage } from '../pages/chats/chats';
import { LoginPage } from '../pages/login/login';
import template from "./app.html";

@Component({
template
})
export class MyApp {
rootPage = ChatsPage;
rootPage: any;

constructor(platform: Platform) {
this.rootPage = Meteor.user() ? ChatsPage : LoginPage;

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.
Expand Down

0 comments on commit 524b3a6

Please sign in to comment.