ngx-formly 模板 "pdfviewer" 在我的自定义输入模板中使用
ngx-formly template "pdfviewer" using inside my custom input template
我创建了一个 ngx-formly 模板来选择 pdf 文件并使用另一个模板在内部可视化它 "custom input file"
这是主窗体声明:
fields: FormlyFieldConfig[] = [
{
key: 'pdfsource',
type: 'pdfviewer',
templateOptions: {
label: 'Choose pdf file',
placeholder: 'choose File',
required: true,
}
},
]
我收到这个错误:
错误
错误:[形式错误] 没有名称为 "undefined"
的类型
这是stackbiz
https://stackblitz.com/edit/ngx-formly-ui-bootstrap-htuh7z
我找到了这个解决方案:
https://stackblitz.com/edit/ngx-formly-ui-bootstrap-mcvzfp
https://ngx-formly-ui-bootstrap-mcvzfp.stackblitz.io
这是模型结构:
model = {
file:{
filename: 'name.pdf',
filevalue: null
}
和 formlyconfig:
fields: FormlyFieldConfig[] = [
{
key: 'file',
type: 'pdfviewerinput',
templateOptions: {
label: 'Choose File',
placeholder: 'choose File',
filename: 'filename',
filevalue: 'filevalue',
required: true,
}
}]
ngx-formly 模板 pdfviewerinput 包括:
- ngx-formly 模板 pdfviewer -> 可视化 pdf
- ngx-formly 模板输入文件 -> 选择文件
我创建了一个 ngx-formly 模板来选择 pdf 文件并使用另一个模板在内部可视化它 "custom input file"
这是主窗体声明:
fields: FormlyFieldConfig[] = [
{
key: 'pdfsource',
type: 'pdfviewer',
templateOptions: {
label: 'Choose pdf file',
placeholder: 'choose File',
required: true,
}
},
]
我收到这个错误: 错误 错误:[形式错误] 没有名称为 "undefined"
的类型这是stackbiz https://stackblitz.com/edit/ngx-formly-ui-bootstrap-htuh7z
我找到了这个解决方案:
https://stackblitz.com/edit/ngx-formly-ui-bootstrap-mcvzfp https://ngx-formly-ui-bootstrap-mcvzfp.stackblitz.io
这是模型结构:
model = {
file:{
filename: 'name.pdf',
filevalue: null
}
和 formlyconfig:
fields: FormlyFieldConfig[] = [
{
key: 'file',
type: 'pdfviewerinput',
templateOptions: {
label: 'Choose File',
placeholder: 'choose File',
filename: 'filename',
filevalue: 'filevalue',
required: true,
}
}]
ngx-formly 模板 pdfviewerinput 包括:
- ngx-formly 模板 pdfviewer -> 可视化 pdf
- ngx-formly 模板输入文件 -> 选择文件