Angular 在剑道文本区域中提供默认只读值,该值应能够附加用户输入的值
我正在为angular使用剑道UI(目前在版本9上)。我希望有一个文本区域,其中有一些默认值。 默认值应为不可编辑/只读,但文本区域仍应接受用户输入,并将用户输入附加到现有默认值。Angular 在剑道文本区域中提供默认只读值,该值应能够附加用户输入的值,angular,kendo-ui,textarea,kendo-ui-angular2,Angular,Kendo Ui,Textarea,Kendo Ui Angular2,我正在为angular使用剑道UI(目前在版本9上)。我希望有一个文本区域,其中有一些默认值。 默认值应为不可编辑/只读,但文本区域仍应接受用户输入,并将用户输入附加到现有默认值。 这就像有一个永久的占位符,可以附加用户输入值。您考虑过一个 import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: ` <fieldset>
这就像有一个永久的占位符,可以附加用户输入值。您考虑过一个
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<fieldset>
<legend>{{readonlyPreface}}</legend>
<textarea
kendoTextArea
(valueChange)="forcedPreface($event)"
>{{myTextArea}}</textarea>
</fieldset>
<hr>
Combined: <textarea readonly>{{combined}}</textarea>
`
})
export class AppComponent {
combined: string;
readonlyPreface = "Diagnosis: ";
forcedPreface(event) {
this.combined = this.readonlyPreface + event;
}
}
从'@angular/core'导入{Component};
@组成部分({
选择器:“我的应用程序”,
模板:`
{{readonlyPreface}}
{{myTextArea}}
组合:{{Combined}
`
})
导出类AppComponent{
组合:字符串;
readonlyPreface=“诊断:”;
强制执行(事件){
this.combined=this.readonlyPreface+事件;
}
}