I'm learning Polymer. I've been trying to integrate Polymer into an existing page. In an attempt to do that, I have the following:
<body>
<div class="row">
<div class="col-sm-8">
<template is="dom-bind" id="app">
<iron-signals on-iron-signal-update-greeting="_updateGreeting">
<div>[[ greeting ]]</div>
</template>
</div>
<div class="col-sm-4">
<button type="button" click="testClick();">Test</button>
</div>
</div>
<script type="text/javascript">
function testClick() {
this.fire('iron-signal', { name: 'updateGreeting', data: { value: 'Hello at ' + (new Date().getMinutes()) } });
}
</script>
</body>
This is a learning exercise regarding iron-signals
. I understand how to use iron-signals within a Polymer app. However, I'm trying to fire off a signal from outside of the app. When I do this, I get the following error:
this.fire is not a function
I understand why I'm getting the error. However, I guess I don't understand how to get a reference to the actual Polymer object so that I can call the fire
function.