Closed balupton closed 10 years ago
Another use case for this is avoiding the shadow dom when using polymer:
<!DOCTYPE html>
<head>
<title>GSKU — Simple</title>
<script src="#{SITE_URL}bower_components/platform/platform.js"></script>
<link rel="import" href="#{SITE_URL}bower_components/polymer/polymer.html" />
<link rel="import" href="#{SITE_URL}bower_components/core-ajax/core-ajax.html">
</head>
<body>
<template id="t" bind="{{}}">
<core-ajax auto url="//localhost:8000/usku" handleAs="json" on-core-response="{{parseUSKUS}}"></core-ajax>
Hello {{name}}
</template>
<script>
var t = document.querySelector('#t')
t.model = {
name: 'Joe',
parseUSKUS: function(){
debugger; // never reached
}
}
</script>
</body>
you can currently use these inside a polymer element: http://www.polymer-project.org/docs/polymer/databinding.html#event-handling-and-data-binding
there is some debate if it can be moved into https://github.com/Polymer/polymer-expressions, and it was supported in https://github.com/Polymer/polymer-expressions/issues/20 but I think has since been reverted. I'll ping over at that issue
It would be great if this supported event bindings too:
Currently, clicking sup does nothing. Demo: http://jsbin.com/qapeq/edit
Happy to accept if there is a technical reason for why this is a really bad idea.