I basically want to write the following code in ES6 fashion.
listeners: {
'neon-animation-finish': '_onNeonAnimationFinish'
},
I have tried using a property like the following but the _onNeonAnimationFinish
callback is never fired.
class MyElement {
get behaviors() {
return [Polymer.NeonAnimationRunnerBehavior];
}
beforeRegister() {
this.is = 'my-element';
this.properties = {
name: {
type: String
}
};
this.listeners = {
'neon-animation-finish': '_onNeonAnimationFinish'
};
}
So what is the correct way?
get listeners()
function which returns{'neon-animation-finish':'_onNeonAnimationFinish'}
should do it. – TarrantNeonAnimationRunnerBehavior
, specifically the property_animationMeta
meta isn't present on the instance of the element. You should get the error Uncaught TypeError: Cannot read property 'byKey' of undefined in your console when you run the methodplayAnimation
on the instance. Can you confirm if there is indeed such an error in console?. – Terbia