[英]Access HTML element value inside NgClass
so i would like to retrieve the value of an html input inside it's ngClass to compare it later in a pipe . 所以我想在ngClass中检索html输入的值,以便稍后在管道中进行比较。 Exemple :
范例:
<input type="email" ... [ngClass]="myPipe(input.value)" >
Or maybe like this : 或者像这样:
<input type="email" ... [ngClass]="item.value | myPipe" >
Do you know any way of achieving this ? 您知道实现此目标的任何方法吗?
Thanks . 谢谢 。
从我上面的评论复制:
<input type="email" #myInput [ngClass]="myPipe( myInput.value )" >
尝试这个:
<input type="email" [ngModel]="input.value" [ngClass]="myPipe(input.value)" >
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.