Can't bind ngModel.errors
in condition of *ngSwitchCase
.
But if i do this on *ngIf
, it's work fine for me.
I wan't make a structure of displaying different's error's in condition of *ngSwitchCase
.
StackBlitz sandbox
我try 了*ngSwitchCase="name.errors?.required"
的不同版本,但唯一对我有效的解决方案是*ngIf="name2.errors?.required"
.
但我想做4个或更多的错误条件,我认为在*ngSwitchCase
个条件下做会更正确和可读性更好,但在开始学习Angular 后,我不能理解为什么这个指令不起作用.
预先感谢您的回答