ฉันใช้ core-ajax เพื่อส่งวัตถุ json สำเร็จแล้ว แต่ฉันต้องการเขียนองค์ประกอบที่กำหนดเองที่สามารถส่งผ่านค่าง่าย ๆ ได้ นี่คือสิ่งที่ฉันมี แต่มันใช้งานไม่ได้
องค์ประกอบ testOutput
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="testOutput">
<template>
This doesn't do anything but output a value.
</template>
<script>
Polymer('testOutput', {
response: "MyValue"
});
</script>
</polymer-element>
องค์ประกอบ testInput
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="testInput" noscript attributes="input">
<template>
Here is the value from the other element:
<h1>{{input}}</h1>
</template>
</polymer-element>
ดัชนี.html
<testOutput response="{{output}}"></testOutput>
<testInput input="{{output}}"></testInput>
เอาท์พุท
สิ่งนี้ไม่ได้ทำอะไรนอกจากส่งออกค่า
นี่คือค่าจากองค์ประกอบอื่น: