我正在使用http://angular-formly.com/而我仍然坚持在选择下拉列表标签下添加说明。
app.controller('CalcCtrl', function CalcCtrl(formlyVersion, formlyValidationMessages) {
var vm = this;
// function assignment
vm.onSubmit = onSubmit;
// variable assignment
vm.model = {
};
vm.fields = [
{
key: 'am_quant_lg',
type: 'input',
templateOptions: {
required: true,
label: 'Large',
description: 'Description of my input field is here',
type: 'number',
max: '100',
maxMessage: 'test ',
},
},
{
key: 'House_type',
type: 'select',
templateOptions: {
required: true,
label: 'What type of House you need?',
options: [{
name: 'Townhouse',
value: 1,
},
{
name: 'Single',
value: 2,
},]
},
},
所以我需要在“你需要什么类型的房子”标签下面显示一些描述?也许几行。我知道如何在输入文本字段中添加说明,如上所示。我知道如何将描述添加到其他选项中。只需要帮助主要的Select元素?
答案 0 :(得分:0)
显然不在文档中,但你仍然可以用同样的方式添加它;
{
key: 'House_type',
type: 'select',
templateOptions: {
required: true,
label: 'What type of House you need?',
description: 'Description goes here?',
options: [{
name: 'Townhouse',
value: 1,
},
{
name: 'Single',
value: 2,
},]
},