text: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  var __metadata = (this && this.__metadata) || function (k, v) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  };
  import { Component } from '@angular/core';
  import { AlertController, NavController } from 'ionic-angular';
  import { UserData } from '../../providers/user-data';
  var AccountPage = (function () {
      function AccountPage(alertCtrl, nav, userData) {
          this.alertCtrl = alertCtrl;
          this.nav = nav;
          this.userData = userData;
      }
      AccountPage.prototype.ngAfterViewInit = function () {
          this.getUsername();
      };
      AccountPage.prototype.updatePicture = function () {
          console.log('Clicked to update picture');
      };
      // Present an alert with the current username populated
      // clicking OK will update the username and display it
      // clicking Cancel will close the alert and do nothing
      AccountPage.prototype.changeUsername = function () {
          var _this = this;
          var alert = this.alertCtrl.create({
              title: 'Change Username',
              buttons: [
                  'Cancel'
              ]
          });
          alert.addInput({
              name: 'username',
              value: this.username,
              placeholder: 'username'
          });
          alert.addButton({
              text: 'Ok',
              handler: function (data) {
                  _this.userData.setUsername(data.username);
                  _this.getUsername();
              }
          });
          alert.present();
      };
      AccountPage.prototype.getUsername = function () {
          var _this = this;
          this.userData.getUsername().then(function (username) {
              _this.username = username;
          });
      };
      AccountPage.prototype.changePassword = function () {
          console.log('Clicked to change password');
      };
      AccountPage.prototype.logout = function () {
          this.userData.logout();
          this.nav.setRoot('LoginPage');
      };
      AccountPage.prototype.support = function () {
          this.nav.push('SupportPage');
      };
      AccountPage = __decorate([
          Component({
              selector: 'page-account',template:/*ion-inline-start:"/home/harish/myFristApp/mobileai/src/pages/account/account.html"*/'<ion-header>\n  <ion-navbar>\n    <button ion-button menuToggle>\n      <ion-icon name="menu"></ion-icon>\n    </button>\n    <ion-title>Account</ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content class="outer-content">\n  <div padding-top text-center *ngIf="username">\n    <img src="http://www.gravatar.com/avatar?d=mm&s=140" alt="avatar">\n    <h2>{{username}}</h2>\n\n    <ion-list inset>\n      <button ion-item (click)="updatePicture()">Update Picture</button>\n      <button ion-item (click)="changeUsername()">Change Username</button>\n      <button ion-item (click)="changePassword()">Change Password</button>\n      <button ion-item (click)="support()">Support</button>\n      <button ion-item (click)="logout()">Logout</button>\n    </ion-list>\n  </div>\n</ion-content>\n'/*ion-inline-end:"/home/harish/myFristApp/mobileai/src/pages/account/account.html"*/
          }),
          __metadata("design:paramtypes", [AlertController, NavController, UserData])
      ], AccountPage);
      return AccountPage;
  }());
  export { AccountPage };
  //# sourceMappingURL=account.js.map