You are viewing a single comment's thread from:

RE: [SwapSteem] Account holder name value bound to same data as SWIFT/BIC code

in #utopian-io7 years ago

Yeah, I forgot about this one hah.

Yeah although I know the issue, and although I'm sure with a bit more effort I could find the exact place, I'm more in Vue than angular. As you mentioned you had trouble understanding I'll try to explain the issue if it was in Vue ;) hah. Not sure if you know Vue, but I know you know some JS so this hopefully it's clear enough :)

Below you can see an example of data item I have defined, I have defined accountHolderName: ''

data () {
    return {
          accountHolderName: ''
}
}

and then within your form, you had two items:

<form>
<input type="text" id="holder-name" :model="accountHolderName" />
<input type="text" id="swift-code" :model="accountHolderName" />
</form

as you can see within the form there are two input fields, both of these have :model="accountHolderName". This means that anything I type in that field will be stored in accountHolderData as they're both sharing the same data this means that they share the same value. For example, if I type "hello" in the holder-name input field the data I previously defined will now be set to:

data () {
    return {
          accountHolderName: 'hello'
}
}

and as they both share accountHolderName and because Vue (and angular) are reactive the value of the swift-code input will show as the same value due to them being shared.

Sort:  

Ohh .. Thanks for that, I completely missed this reply, Now that you have explained it, I understand it better. It's an honest mistake, probably in a bid to save time he had duplicated the first input code in the second line and forgot to edit the value for :model in the swift code input

Coin Marketplace

STEEM 0.09
TRX 0.30
JST 0.033
BTC 110587.74
ETH 3911.40
USDT 1.00
SBD 0.58