Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. this.mediaCapture.captureImage()
  2. .then(
  3.  
  4. (data: MediaFile[]) => {
  5. this.navCtrl.push('NewPostPage', {
  6. mediaFile : data
  7. })
  8. },
  9. (err: CaptureError) => console.error(err)
  10. );
  11.  
  12. <ion-content padding>
  13.  
  14. <ion-img [src] = 'image'></ion-img>
  15.  
  16. </ion-content>
  17.  
  18. import { Component } from '@angular/core';
  19. import { IonicPage, NavController, NavParams } from 'ionic-angular';
  20. import { MediaFile } from '@ionic-native/media-capture';
  21.  
  22. /**
  23. * Generated class for the NewPostPage page.
  24. *
  25. * See http://ionicframework.com/docs/components/#navigation for more info
  26. * on Ionic pages and navigation.
  27. */
  28. @IonicPage()
  29. @Component({
  30. selector: 'page-new-post',
  31. templateUrl: 'new-post.html',
  32. })
  33. export class NewPostPage {
  34.  
  35. constructor(public navCtrl: NavController, public navParams: NavParams) {
  36. }
  37.  
  38. mediaFile: MediaFile[] = this.navParams.get('mediaFile');
  39. image: string = this.mediaFile['0'].fullPath;
  40.  
  41.  
  42. ionViewDidLoad() {
  43. console.log('ionViewDidLoad NewPostPage');
  44. console.log(this.image);
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement