我有一个文本区域,我想在单击按钮时设置文本区域的值。但是我必须通过输入一些单词来触发文本区域。
是否可以在不触发的情况下设置值?
TextArea代码:
<textarea class="md-height" matInput [placeholder]="getEntityMeta('function').fieldDescription" type="text" name="function" [(ngModel)]="salaryformulaEntity.function" #function="ngModel" [disabled]="salaryformulaEntity.isUnmodified()" [required]="getEntityMeta('function').mandatory" [wynixMandatory]="getEntityMeta('function').mandatory" [wynixMaxLength]="getEntityMeta('function').maxLength"></textarea>
设置值的逻辑
selectComponent() : void{
for (let index = this.componentLov.length - 1; index >= 0; index--) {
const component: LOVItem = this.componentLov[index];
if(component.options.selected){
if(this.chipList.selected){
this.salaryformulaEntity.function = this.salaryformulaEntity.function.concat(this.chipList.selected.value + "(" + component.options.code +")" + " ") ;
}else {
this.salaryformulaEntity.function = this.salaryformulaEntity.function.concat(component.options.code + " ");
}
component.options.selected = false;
}
this.filterComponentsLov();
this.filterFunctionsLov();
this.filterFormulasLov()
}
}
任何帮助或建议将不胜感激
答案 0 :(得分:0)
“您可以在点击操作级别分配文本区域值:在按钮逻辑内添加salumformulaEntity.function =“ newValue”“