Is it possible to use a variable declared within a function in another page? Here's the scenario: On the home page, I capture an image using the following code:
capture(event, fab: FabContainer) {
fab.close();
const cameraOptions: CameraOptions = {
quality: 50,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
correctOrientation: true
};
this.camera.getPicture(cameraOptions).then((imageData) => {
this.captureDataUrl = ('data:image/jpeg;base64,' + imageData);
this.upload();
}, (err) => {
});
}
Now I want to pass this.captureDataUrl
to a filter page, perform some operations, and then send it back to the home page to update the existing image. Is this achievable?