Polymer Dom-repeat Error Parsing The Array Inside The Object
Trying to fiddle with Polymer framework for my small project. Polymer dom-repeat error parsing the array inside the object Following is the code invocation
Solution 1:
The problem should be that on the attribute's value you're passing functions instead of values.
For example:
rooms: {
type: Array,
value: function() {
var testData = [
{
name: "Room1",
maxPorts: 16,
ports:{
type: Array,
value: function() {
var testData = [
{portName: "Port 1",portStatus: "true"},
{portName: "Port 2",portStatus: "true"},
{portName: "Port 3",portStatus: "true"},
{portName: "Port 4",portStatus: "true"},
];
return testData;
}
}
}
] // Also you've missed this close bracket.
}
}
This room attribute should be writed like this:
rooms: {
type: Array,
value: [
{
name: "Room1",
maxPorts: 16,
ports: [
{portName: "Port 1",portStatus: "true"},
{portName: "Port 2",portStatus: "true"},
{portName: "Port 3",portStatus: "true"},
{portName: "Port 4",portStatus: "true"},
]
}
]
}
There're other places on your code that you're doing this, so you'll need to fix them too.
Post a Comment for "Polymer Dom-repeat Error Parsing The Array Inside The Object"