javascript - How to propagate value from one custom element to another in Polymer 1.0? -


i have 2 custom elements. student-details.html , student-service.html

student-details.html looks this

<link rel="import" href="../bower_components/polymer/polymer.html">  <link rel="import" href="student-service.html">  <dom-module id="student-details">  <style>  </style>  <template>  	<h1>student details</h1>  <h1>{{studentid}}<h1> //this value printed  	<student-service   user-data={{studentid}} service-name="studentdetails"  response-data={{responsedata}} ></student-service>            	<h1>{{responsedata.name}}</h1>      	<img width="70" height="70" src="{{responsedata.image}}" />      	<h1>{{responsedata.qualification}}</h1>        	<h1>{{responsedata.speciality}}</h1>      	<h1>{{responsedata.phone}}</h1>        	<h1>{{responsedata.email}}</h1>        	<template is="dom-repeat" items="{{responsedata.addresses}}">      	<h1>{{item.street}}</h1>      	<h1>{{item.area}}</h1>      	</template>    </template>  <script>  polymer({  is:'student-details',  properties:{  	studentid: string,  	notify: true  }    });    </script>  </dom-module>

the student-service takes input studentid , returns response in responsedata.

if access value studentid in student-details.html using {{studentid}} displays, not able send same value user-data input in student-service element.

note: if hardcode studentid, works well. think not following proper way of passing value. kindly suggest

feel free use iron-ajax

using polymer ajax response

https://elements.polymer-project.org/elements/iron-ajax

i hope can help.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -