These are chat archives for canjs/canjs

21st
Apr 2017
Gira Minus
@gKreator
Apr 21 2017 00:44
does {($value)}="item.name" can-stache-converters work right out of the box or do you have to import and assign something?
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:45
That's part of can-stache-bindings
Gira Minus
@gKreator
Apr 21 2017 00:45
import "can-stache-converters";
is that all you have to do?
ohh bindings
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:46
Should be, yeah, and with converters you get things like {($value)}="equal(~val, 'foo')"
(can-stache-converters itself imports can-stache-bindings, since the two work together)
Gira Minus
@gKreator
Apr 21 2017 00:47
seems to not be working
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:47
Any console errors with that?
Gira Minus
@gKreator
Apr 21 2017 00:48
nope
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:48
Hm.
Can you repro this in a JSBin?
Gira Minus
@gKreator
Apr 21 2017 00:49
it works in a jsbin
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:49
OK.
Gira Minus
@gKreator
Apr 21 2017 00:50
im using steal and such on the actual app, so just wondering if i have to import anything special
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:51
You can try importing can-stache-bindings directly, but I think your issue might be elsewhere, like if you're creating a context around the place where you're doing this binding (like, if you made a stache section)
Gira Minus
@gKreator
Apr 21 2017 01:06
omg
it only works if the value is a number
wtf
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:06
Your viewmodel is a DefineMap?
Gira Minus
@gKreator
Apr 21 2017 01:07
and it does not update the map
yes
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:08
I had a similar problem recently that made a property undefined all the time, and it was due to a separate definition setter happening that blanked out the value. I don't know if that's your issue, but maybe try commenting out your other defined values
Gira Minus
@gKreator
Apr 21 2017 01:08
just noticed something crazy
nested properties are bleeding into the parent object of my definemap
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:10
a-ha. That is crazy
Gira Minus
@gKreator
Apr 21 2017 01:11
blob
why would this be happening
lol
omg
im giving up
after 3 more hours
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:17
Weird that there's meow but not driver_name
Gira Minus
@gKreator
Apr 21 2017 01:17
well technically it wants 123 and it cannot be 123 since it is a number
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:19
Well also, 123asd is a value of a prop and also a prop itself.
That's not right. Something is off.
Gira Minus
@gKreator
Apr 21 2017 01:19
canjs is broken
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:21
can I see some snippets of your stache?
Gira Minus
@gKreator
Apr 21 2017 01:23
blob
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:23
Oh, minor quibble here.
Gira Minus
@gKreator
Apr 21 2017 01:24
hmm?
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:24
You have the {($value)} attribute values in magic tags.
Gira Minus
@gKreator
Apr 21 2017 01:24
omg
:/
fml
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:24
{{truck.truckNumber}} should be just truck.truckNumber, for example
Gira Minus
@gKreator
Apr 21 2017 01:24
yes
thats why it was binding back the model back to itself in some weird space time event
not sure how my cpu did it
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:28
Is that unblocking you?
Gira Minus
@gKreator
Apr 21 2017 01:28
yup that fixed it
just gotta make sure it works with ajax now so im rewriting it again i deleted stuff to debug
thanks tho
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:29
:+1:
Gira Minus
@gKreator
Apr 21 2017 01:30
and ajax works
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:30
Gooood stuff
Gira Minus
@gKreator
Apr 21 2017 01:30
omg i spent like 8 hours on this in the last like 2 days
even made a jsbin and such
i wish canjs would throw an error for dumb stuff like that but ohh well
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:32
It's not necessarily wrong, it's just like doing double dollarsigns in PHP, like "take this value and use it as the key"
Gira Minus
@gKreator
Apr 21 2017 01:33
ahh true
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:33
Maybe it's not the way an opinionated framework would do it. But without that we wouldn't have any way of dynamically declaring bindings
We should solicit some community feedback, and see who's more harmed by rejecting it vs not.
Gira Minus
@gKreator
Apr 21 2017 01:34
and canjs gods, im sorry for ever doubting you
Gira Minus
@gKreator
Apr 21 2017 02:14
:D