Add ignore fields without a name
This commit is contained in:
parent
1771eeb338
commit
740f31092c
@ -96,12 +96,14 @@ class Serializer {
|
||||
*/
|
||||
addField(f) {
|
||||
let fieldName = f.getAttribute("name");
|
||||
if(!fieldName) {
|
||||
return
|
||||
}
|
||||
|
||||
let isArray = fieldName.match(/^\[(\d*)\]/);
|
||||
|
||||
fieldName = fieldName.replace(/^\[\d*\]/, "");
|
||||
|
||||
console.log(f)
|
||||
|
||||
let field;
|
||||
if (f.tagName == "GROUP") {
|
||||
field = new Serializer(f);
|
||||
|
@ -19,6 +19,7 @@
|
||||
{{ range $k, $p := . }}
|
||||
{{ if $p }}
|
||||
<group name="[{{ $k }}]">
|
||||
<input value="something without a name">
|
||||
<input name="name" type="text" value="{{ $p.Name }}">
|
||||
<input name="surname" type="text" value="{{ $p.Surname }}">
|
||||
<input name="age" type="number" value="{{ $p.Age }}">
|
||||
|
Loading…
Reference in New Issue
Block a user