XML FILE
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<myTasks>
<status>OK</status>
<task subject="Natures" label="Détails"/>
</myTasks>
//custom element trying to got the xml attributes
<polymer-element name="test-t" attributes="url">
<template>
<sidebar-layout selected="notes">
<div class="title">test</div>
<core-ajax auto
id ="ajax"
url='http://192.168.43.65:888/respnse.xml'
handleAs="xml"
method="GET"
headers='{"Accept-Language":"fr-FR"}'
response="{{resp}}"
on-core-response="{{ajaxResponse}}">
</core-ajax>
<template repeat="{{myTasks in resp |
nodeList('myTasks')}}">
<strong>{{myTasks | nodeText('task.label')}}</strong>
<strong>{{myTasks | nodeText('task.subject')}}</strong>
</template>
</sidebar-layout>
</template>
<script>
Polymer('test-t',{
nodeList: function(element, name) {
return element ?
[].slice.call(element.querySelectorAll(name)) : []
},
nodeText: function(element, name) {
return element.querySelector(name).innerHTML;
}
});
</script>
</polymer-element>
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/a237a773-700b-46fc-930e-3c670cb906f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.