We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With this Code you can 2-way-bind to Polymer Properties:
ko.bindingHandlers['polymer'] = { 'init': function (element, valueAccessor, allBindings) { var eventsToHandle = valueAccessor() || {}; ko.utils.objectForEach(eventsToHandle, function (eventName, value) { if (typeof eventName == "string") { var polymerEvent = eventName.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase() + '-changed'; var listener = function(e) { value(e.detail.value); }; element.addEventListener(polymerEvent, listener); ko.utils.domNodeDisposal.addDisposeCallback(element, function () { element.removeEventListener(polymerEvent, listener); }); } }); }, 'update': function (element, valueAccessor, allBindings) { var value = ko.utils.unwrapObservable(valueAccessor()) || {}; ko.utils.objectForEach(value, function (attrName, attrValue) { attrValue = ko.utils.unwrapObservable(attrValue); element[attrName] = attrValue; }); } };
The text was updated successfully, but these errors were encountered:
IMPL IN #2176
Sorry, something went wrong.
No branches or pull requests
With this Code you can 2-way-bind to Polymer Properties:
The text was updated successfully, but these errors were encountered: