Last active
August 29, 2015 14:13
-
-
Save vance/71852004857f0534255d to your computer and use it in GitHub Desktop.
custom element, trying to bind object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../../../../bower_components/polymer/polymer.html" /> | |
<polymer-element name="some-input" attributes="boundModel"> | |
<template> | |
<div> | |
<input id="inputField" type="text" value="{{boundModel.prop}}" on-click="{{setFocus}}"> | |
output: {{boundModel.prop}} | |
</div> | |
</template> | |
<script type="application/javascript"> | |
Polymer("some-input", { | |
publish:{ | |
boundModel: { value: { | |
name: 'default' | |
}, reflect:true} | |
}, | |
created: function(){ | |
}, | |
ready: function() { | |
Debug.log('I, POLYMER, ARE READY'); | |
}, | |
setFocus: function() | |
{ | |
Debug.log( 'set Focus'); | |
this.$.inputField.focus(); | |
// this.$.inputField.value = 'oops'; | |
this.boundModel = 'ooopsies'; | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment