Skip to content

Commit

Permalink
Step 13.38: Implement getPic
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Jun 13, 2017
1 parent e5d1e33 commit 4f4a085
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/pages/chats/new-chat.ts
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Chats, Users } from 'api/collections';
import { Chats, Users, Pictures } from 'api/collections';
import { User } from 'api/models';
import { AlertController, ViewController } from 'ionic-angular';
import { AlertController, Platform, ViewController } from 'ionic-angular';
import { MeteorObservable } from 'meteor-rxjs';
import { _ } from 'meteor/underscore';
import { Observable, Subscription, BehaviorSubject } from 'rxjs';
Expand All @@ -18,7 +18,8 @@ export class NewChatComponent implements OnInit {

constructor(
private alertCtrl: AlertController,
private viewCtrl: ViewController
private viewCtrl: ViewController,
private platform: Platform
) {
this.senderId = Meteor.userId();
this.searchPattern = new BehaviorSubject(undefined);
Expand Down Expand Up @@ -107,4 +108,12 @@ export class NewChatComponent implements OnInit {

alert.present();
}

getPic(pictureId): string {
let platform = this.platform.is('android') ? "android" :
this.platform.is('ios') ? "ios" : "";
platform = this.platform.is('cordova') ? platform : "";

return Pictures.getPictureUrl(pictureId, platform);
}
}

0 comments on commit 4f4a085

Please sign in to comment.