Files
gerrit/polygerrit-ui/app/samples/bind-parameters.html
Paladox none 003a35cdf2 Remove _legacyUndefinedCheck from the samples modules
Change-Id: Ibb519face3dd9e47fe539f774b5ec6f12f2cc8fe
2019-10-24 21:39:41 +00:00

39 lines
1000 B
HTML

<dom-module id="bind-parameters">
<script>
Gerrit.install(plugin => {
plugin.registerCustomComponent(
'change-view-integration', 'my-bind-sample');
});
</script>
</dom-module>
<dom-module id="my-bind-sample">
<template>
Template example: Patchset number [[revision._number]]. <br/>
Computed example: [[computedExample]].
</template>
<script>
Polymer({
is: 'my-bind-sample',
properties: {
computedExample: {
type: String,
computed: '_computeExample(revision._number)',
},
},
attached() {
this.plugin.attributeHelper(this).bind(
'revision', this._onRevisionChanged.bind(this));
},
_computeExample(value) {
if (!value) { return '(empty)'; }
return `(patchset ${value} selected)`;
},
_onRevisionChanged(value) {
console.log(`(attributeHelper.bind) revision number: ${value._number}`);
},
});
</script>
</dom-module>