You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is a bug, if I am doing something wrong or what. In my changes to one of the examples below, I am trying to trigger an event when the submit button is clicked. However, I get the following error:
Uncaught ReferenceError: handleSubmitClick is not defined
diff --git a/examples/databind-event-callback/main.go b/examples/databind-event-callback/main.go
index f9fb5aa..d9b7133 100644
--- a/examples/databind-event-callback/main.go
+++ b/examples/databind-event-callback/main.go
@@ -34,4 +34,10 @@ func (n *NameTag) HandleNameChange(e *polymer.Event) {
})
}
+func (n *NameTag) HandleSubmitClick(e *polymer.Event) {
+ polymer.Async(1, func() {
+ polymer.Log("Submit clicked")
+ })
+}
+
func main() {}
diff --git a/examples/databind-event-callback/name-tag.html b/examples/databind-event-callback/name-tag.html
index 2ec151b..ce36d90 100644
--- a/examples/databind-event-callback/name-tag.html
+++ b/examples/databind-event-callback/name-tag.html
@@ -15,6 +15,7 @@
The go code bound to it will output the name to the console using fmt.Printf. See main.go.<br />
Each name-tag element is also completely independent, backed by a different instance of the NameTag structure<br />
The Go generated ID of this particular name tag is <b>{{id}}</b>
+ Name: <input type="submit" onclick="handleSubmitClick" /><br />
</template>
<script>PolymerGo("name-tag")</script>
-</dom-module>
\ No newline at end of file
+</dom-module>
I get the same error when I try to use a property change event like this:
I am not sure if this is a bug, if I am doing something wrong or what. In my changes to one of the examples below, I am trying to trigger an event when the submit button is clicked. However, I get the following error:
I get the same error when I try to use a property change event like this:
However, if I do this in the Created function, it works:
The text was updated successfully, but these errors were encountered: