core-ajax xml attributes failed

30 views
Skip to first unread message

james...@gmail.com

unread,
Mar 14, 2015, 8:38:22 PM3/14/15
to polym...@googlegroups.com
   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>

Rob Dodson

unread,
Mar 17, 2015, 3:19:42 PM3/17/15
to james...@gmail.com, polymer-dev
this might be a better questions for StackOverflow, or if it seems like a bug, you might consider filing it against the repo (https://github.com/polymer/core-ajax)

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 polymer-dev...@googlegroups.com.
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.

Reply all
Reply to author
Forward
0 new messages