如何使用angular-formly在字段中设置类似.input-sm的类?
例:
<input class="form-control input-sm" name="test" type="text" placeholder=".input-sm">
答案 0 :(得分:2)
Here you go。只需使用ngModelElAttrs
属性:
{
key: 'yourKey',
type: 'input',
ngModelElAttrs: {
class: 'form-control input-sm' // <-- this is it!
},
templateOptions: {
label: 'Input'
}
}