android - 如何将文本(字符串)插入 ion-textarea?

标签 android typescript ionic-framework ionic3

我已经试过了:

示例.html:

<ion-textarea placeholder="Enter your thoughts" type="text">Test: {{ textboxContent }} </ion-textarea>


字符串textboxContent"Test"填充。

文本区域中没有任何内容。当然,占位符除外。

最佳答案

您可以使用 ngModel 来实现这一点

<ion-textarea placeholder="Enter your thoughts" type="text" [(ngModel)]="value">Test: {{ textboxContent }} </ion-textarea>

在你的 component.ts 中,

export class Page{
value:string;
  constructor(){
    this.value="some value you want to fill"
  }
}

关于android - 如何将文本(字符串)插入 ion-textarea?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44825987/

相关文章:

ionic-framework - Ionic 4 如何从标签页导航到非标签页保持标签?

javascript - TypeError : navigator. currentLang 不是函数

java - 多种颜色/笔画手势和在同一个 GestureOverlayView 中持续绘图

android - 如何检测android中的顺时针手势

javascript - 有没有办法将 csv 数据转换为值数组

javascript - typescript、jsconfig.json、bower.json 和 vs-code 协同工作

reactjs - 重嵌套对象的 TypeScript 类型

android - 将我们自己的 UI 添加到 View android xml 文件

java - 应用程序在 FirebaseInstanceId.getInstance().getToken() 崩溃

android - 无法构建 Android Cordova 项目 (Ionic 5)