After successfully implementing Ionic Speech Recognition in my project using the Ionic framework documentation, I am now facing a challenge with saving the text or audio input using any form input method like ngmodel or formcontrol.
My attempts to bind the matches variable to ng-model assigned to a new variable have been unsuccessful.
startListening() {
let options = {
language: 'en-US',
matches: 2,
prompt: 'Say Something!'
}
this.speechRecognition.startListening(options).subscribe(matches => {
this.matches = matches;
this.cd.detectChanges();
});
this.isRecording = true;
}
<ion-grid>
<ion-row>
<ion-col *ngIf="matches">
<h3 *ngFor="let match of matches">
{{ match }}
</h3>
<ion-item>
<ion-input type="text" [(ngModel)]="matches">
</ion-input>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
My goal is to see the text displayed in the input field so that I can edit it before saving it to the database.