Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.mediaCapture.captureImage()
- .then(
- (data: MediaFile[]) => {
- this.navCtrl.push('NewPostPage', {
- mediaFile : data
- })
- },
- (err: CaptureError) => console.error(err)
- );
- <ion-content padding>
- <ion-img [src] = 'image'></ion-img>
- </ion-content>
- import { Component } from '@angular/core';
- import { IonicPage, NavController, NavParams } from 'ionic-angular';
- import { MediaFile } from '@ionic-native/media-capture';
- /**
- * Generated class for the NewPostPage page.
- *
- * See http://ionicframework.com/docs/components/#navigation for more info
- * on Ionic pages and navigation.
- */
- @IonicPage()
- @Component({
- selector: 'page-new-post',
- templateUrl: 'new-post.html',
- })
- export class NewPostPage {
- constructor(public navCtrl: NavController, public navParams: NavParams) {
- }
- mediaFile: MediaFile[] = this.navParams.get('mediaFile');
- image: string = this.mediaFile['0'].fullPath;
- ionViewDidLoad() {
- console.log('ionViewDidLoad NewPostPage');
- console.log(this.image);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement