I am trying to handle the selection of a tradingPair
by using a view model helper that will call the function the pair should be sent to: select()
. It is only returning object Object
...
Why isn't Blaze/Meteor correctly passing this value to my helper function?
//HTML
<select class="select-pair-drop" id="pairOptions" {{b "change: handleChange"}}>
{{#each tradingPairs}}
<option value={{this}} name="pairOption">
<span class="base">{{this.base}}</span> / <span class="quote">{{this.quote}}</span>
</option>
{{/each}}
</select>
// JS in a Template.<name>.viewmodel()
handleChange(event) {
event.preventDefault();
const choice = (event.target.value);
console.log(choice);
this.select(choice);
}
The issue is, my console.log
only returns object Object
and the object is seemingly being passed through wrong. Can anyone help me here? I have been struggling on this for awhile - please let me know if I can provide more clarity or information.