Basically I'm just wondering is it possible to have a Web component property value set to an external Javascript object and when the external Javascript object changes my Web component property will update with the same data. Basically the two have binding set up.
I will update this post with some code examples.
Thanks.
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/9f52feb2-cda2-4469-acec-51b30ce82f8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var realtime = (function(){
var module = {};
module.dataModel = {};
onDataEvent: function(webClientMessage){
//In here we handle updates from the realtime service and update the module.dataModel.
modulde.dataModel = "UPDATES FROM WebClientMessage"
}
return module;
}
<dom-module id="wc-sb-realtime-api"> <template> </template> <script> (function() { 'use strict'; Polymer({ is: 'wc-sb-realtime-api', properties: { realTime:{ type: Object, notify:true, } },
created: function () { },
ready: function () { var self = this; realtime.connectionManager.connect(function () { realtime.subscriptionManager.subscribe("TO_SOME_SORT_OF_REALTIMEDATA"); setTimeout(function () {
//This works fine, althought I have to add in a delay to allow the dataModel to get it's initial data from the service. self.set("realTime.dataModel", realtime.dataModel); },3000); }); },
attached: function () {
} }); })(); </script></dom-module>