Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created June 9, 2017 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/54d4586067a8abc1954e5a33d2c451a1 to your computer and use it in GitHub Desktop.
Save matthieu-D/54d4586067a8abc1954e5a33d2c451a1 to your computer and use it in GitHub Desktop.
export class AccountPage {
@ViewChild('avatar') avatarInput;
private s3: any;
public avatarPhoto: string;
public selectedPhoto: Blob;
public attributes: any;
public sub: string = null;
constructor(public navCtrl: NavController,
public user: User,
public db: DynamoDB,
public config: Config,
public camera: Camera,
public loadingCtrl: LoadingController) {
let self = this;
this.attributes = [];
this.avatarPhoto = null;
this.selectedPhoto = null;
this.s3 = new AWS.S3({
'params': {
'Bucket': config.get('aws_user_files_s3_bucket')
},
'region': config.get('aws_user_files_s3_bucket_region')
});
this.sub = AWS.config.credentials.identityId;
user.getUser().getUserAttributes(function(err, data) {
self.attributes = data;
self.refreshAvatar();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment