问题描述
此代码目前位于
oninput="let p=this.selectionStart; this.value=this.value.toupperCase(); this.setSelectionRange(p, p);"
解决方法
首先,您不应该在html中使用this.variableName
,而应该只写variableName
。第二;
<ng-container *ngFor="let p = selectionStart"> .....(oninput)="functionName(p,p)" </ng-container>
如果您未在此代码之外使用ngFor循环,而selectionStart只是一个变量,则可以使用functionName(selectionStart,selectionStart)
可能会做。