Allow read-only properties to participate in upwards data flow.
Yes, that is participate on upwards; restrict like before on downwards.
I think using composition the following element should just work.
<dom-module id="x-ample">
<template>
<x-ajax response="{{data}}" url="[[url]]"></x-ajax>
</template>
<script>
Polymer({
is: 'x-ample',
properties: {
userId: String,
url: {
computed: '_computeUrl(userId)',
readOnly: true
},
data: {
notify: true,
readOnly: true
},
},
_computeUrl: function(userId) {
return '/user/' + userId;
}
});
</script>
<dom-module>
Current behavior is, that passing url down will work. Yeah, why not, you opted in. But getting the response and let it flow up doesn't. That's completely unnecessary b/c that would be opt-in as well.
Obviously readOnly protects us correctly to not get values from above.
http://jsbin.com/vudovi/edit?html,output
Dup of #2632? But this one has the better description/example code.
+1
This change would greatly improve the usecase of writing wrappers around other custom elements. Currently it requires hacks such as computed: '_is(read-only-property)' with _is: function(e) { return e; } to actually make it work.
This is still a problem in 2.x - can we relabel?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!