When a dom-repeat passes an array that is inside an object, I receive this error:
"Cannot read property 'apply' of undefined"
This is the code:
<link rel="import" href="../bower_components/polymer/polymer.html">
<dom-module id="hola-mundo">
<style>
h1{
color: blue;
}
</style>
<template>
<button on-tap="test">myButton</button>
<template is="dom-repeat" items="{{myObject.parameters}}">
<div>{{item.name}}</div>
</template>
</template>
</dom-module>
<script>
Polymer({
is: "hola-mundo",
properties: {
myObject: {
type:Object,
value: {
parameters: {
type: Array,
value: []
},
color: {
type: String,
value: 'red'
}
}
}
},
test: function(){
this.push('myObject.parameters', { 'id': '1', 'name': 'test'});
},
});
</script>
If the array is outside the object it works fine, but I need it to be inside the object.
Can someone correct my code? I have not found the error.
Thank you very much!