html - Passing an <input> element's value as the parameter to an attached event function returning undefined -


edit: okay, wasn't thinking hard, , passing this.value in template won't doing want do. question is: there way in angular element refer it's own properties, how this.value work in normal html?

~

i have following input variable in angular project:

<input     mdinput     [value]   = "this.currentframeproperties.index ? this.currentframeproperties.index : 0"    (change)  = "onframechanged(this.value)" > 

i have placed breakpoint in onframechanged function , determined parameter passed undefined. confused though, why this.value not return value property of input element?

here onframechanged() function:

private onframechanged(frame : number) : void {     // @ position, frame undefined     this.websocketservice.send( "jump frame " + frame); } 

ideas of going awry?

you should not bind in template. instead following:

<input     mdinput     [value]   = "currentframeproperties.index ? currentframeproperties.index : 0"    (change)  = "onframechanged($event)" > 

and use camelcase method names


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -