Hey Guys,
I figured it out.
This one work's now
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-ajax/iron-ajax.html">
<dom-module id="data-provider" is="dom-bind">
<template>
<iron-ajax
auto
id="ajax"
url="application-states.json"
on-response="statesLoaded"
handle-as="json"
verbose="true"
debounce-duration="300">
</iron-ajax>
</template>
<script>
Polymer({
is: 'data-provider',
properties: {
states: {
type: Array,
value: function() { return []; }
}
},
statesLoaded: function() {
// Make a copy of the loaded data
this.states = this.$.ajax.lastResponse;
}
});
</script>
</dom-module>
and using it in the template
<data-provider id="provider"></data-provider>
If I iterate through my states now with some for-loops to get the keys and
values of the objects and arrays I get the right console output
for (var key in this.states) {
for (var key2 in this.states[key]) {
for (var key3 in this.states[key][key2]) {
var value = this.states[key][key2][key3]
console.log(key+":"+key2+":"+key3+":"+value);
}
}
}
"0:address:Value:ip:port"
"0:address:Generation:1433177415"
"0:address:Version:123"
"0:alive:Value:false"
"0:alive:Generation:1433177415"
"0:alive:Version:123"
"0:name:Value:foo"
"0:name:Generation:1433177415"
"0:name:Version:123"
"0:version:Value:2015.06.01.009"
"0:version:Generation:1433177415"
"0:version:Version:123"
So with the fact, that I don't know the key or rather the second key is
different how can I handle this inside my template with dom-repeat?
Any ideas?
Thx in adnvance.
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/015931c7-f4de-434a-b3a2-3bb394075d80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.