【发布时间】:2017-05-22 17:00:11
【问题描述】:
我想将 item.translatedText 传递给 read 函数。
这里是前端页面。
<ion-card *ngFor="let item of items" >
<ion-card-content>
{{item.translatedText}}
<ion-row>
</ion-row>
<button ion-button clear small icon-left color="primary" (click)="read()">
<ion-icon name="musical-notes"></ion-icon>
这里是后端页面。
async read() : Promise<any> {
//Read the text from the model via TTS
try {
await this.tts.speak(this.translatedText);
}
catch (e) {
console.log(e);
}
}
【问题讨论】:
-
您的前端组件/服务代码会发生什么变化?
-
为什么不在
read函数中将item.translatedText作为参数传递?