angular Argument of type '"price"' is not assignable to parameter of type 'string[]'

原因是类型不对,这里需要一个'string[]类型,而price不是string[],遇到中情况,angualr响应式表单中

hasError第二个参数其实需要的是
string[],但是用string类型并不会报错
formModel.hasError('min', 'price')
而ng build --port可能会报错,所以如下修改即可
formModel.hasError('min', ['price'])


猜你喜欢

转载自blog.csdn.net/qq_32319999/article/details/78398126