Passing image between the pages


#1

I am trying to pass image between two pages

page1.ts

 navigatetofiltereditor(){ 
      let image = this.uploadedImage;   
       this.navCtrl.push(FiltereditorPage,image);
 }

in page2.ts

loadimage:any; 
 constructor(public navCtrl: NavController, public navParams: NavParams) {  
    this.loadimage = this.navParams.get('image');
  }

in page2.html

  <img src="{{ loadimage }}" style="height:400px;" class="edited-image"/>

i dont get an image instead i get a square box


#2

This doesn’t look like ionic v1 code. I change the category to ionic.


#3

mm thanks sujan12 my bad … :slight_smile:


#4

NavParams expect an object to be passed. Right now you’re trying to directly pass an image. Do something like this instead:

   this.navCtrl.push(FiltereditorPage,{ image: image });

#5

thanks…it perfectly worked…I don’t know how i didn’t notice this…:slight_smile: