How to debug scripts in PolymerTemplate

Hi,

I had a PolymerTemplate like:

<template>
	.....
	<slot></slot>
	.....
</template>
<script>
	.....
	someFuntion (fieldid) {
	.....
	}
	.....
</script>

In the sever side, I added some element into the slot like:

getElement().appendChild(ElementFactory.createInput("text").setAttribute("onchange", "someFuntion(this.id)"));

However, when I monitored the browser dom debugger, I found that the input element didn’t trigger the specified function. Any advices of how to debug the scripts in PolymerTemplate?

Best regards,
Joey