import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { User, AuthServiceProvider } from '../../providers/auth-service';

/**
 * Generated class for the UserPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-user',
  templateUrl: 'user.html',
})
export class UserPage {
  private users: Array<any>;
  private singleUser: User;

  constructor(public navCtrl: NavController, public navParams: NavParams,
              public authService: AuthServiceProvider) {
        
            this.singleUser = this.authService.currentUser;
  }

  ionViewDidLoad() {
    
    //this.getUsers();
   
  }

  // getUsers(){
  //   this.authService.getUsers().subscribe(users => {
  //     this.users = users;
  //   })
  // }

  getThisUser(){
    this.authService.getThisUser().subscribe(user => {
      console.log(" bark " + user);
      this.singleUser = user;
    })
  }




}
