I'm struggling to redirect to a different view after scanning a barcode in my Ionic 2 app using barcode-scanner. I've tried the push method but it's not loading the other page, and passing parameters to the new view also doesn't seem to be working. What could I be doing wrong?
Code snippet from the first view:
async scanBarcode(){
this.options = {
prompt : 'Scan a barcode...'
}
this.results = await this.barcode.scan(this.options);
this.navCtrl.push(Infoproducto,{ //this not working
results: this.results
});
//console.log(this.results);
}
This is the code for the view I want to redirect to:
<div *ngIf="results">
<p>{{results.text}}</p>
<p>{{results.format}}</p>
<p>{{results.cancelled}}</p>
</div>