Polymer this.$ undefined in filter -
Polymer this.$ undefined in filter -
i have function called formatdate. functions uses this.$
access global function in global element. problem getting error says this.$
undefined. not sure why ever undefined. defined in ready callback.
edit: added code example. problem seen below in formatdate function. this.$
undefined.
<link rel="import" href="app-globals.html"> <polymer-element name="message-element" attributes="message"> <template> <style> :host { display: block; } .message { padding: 10px; display: inline-block; margin-bottom: 6px; margin-right: 6px; margin-left: 6px; color: white; clear: both; max-width: 700px; } .sent-message { background-color: #3f51b5; float: right; } .received-message { background-color: #c5cae9; float: left; } .sent-time { font-size: 70%; opacity: .54; } .clear { clear: both; display: block; } </style> <div class="message {{message.type}}-message"> <app-globals id="globals"></app-globals> <div> {{message.message}} </div> <div class="sent-time"> {{message.sentdatetime | formatdate}} </div> </div> </template> <script> polymer({ formatdate: function(datestr) { //console.log(this.$); if(this.$ != null) { homecoming this.$.globals.formatdate(datestr); } } }); </script> </polymer-element>
polymer
Comments
Post a Comment