These are chat archives for canjs/canjs

21st
Apr 2017
Gira Minus
@gKreator
Apr 21 2017 00:44 UTC
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 UTC
That's part of can-stache-bindings
Gira Minus
@gKreator
Apr 21 2017 00:45 UTC
import "can-stache-converters";
is that all you have to do?
ohh bindings
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:46 UTC
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 UTC
seems to not be working
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:47 UTC
Any console errors with that?
Gira Minus
@gKreator
Apr 21 2017 00:48 UTC
nope
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:48 UTC
Hm.
Can you repro this in a JSBin?
Gira Minus
@gKreator
Apr 21 2017 00:49 UTC
it works in a jsbin
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 00:49 UTC
OK.
Gira Minus
@gKreator
Apr 21 2017 00:50 UTC
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 UTC
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 UTC
omg
it only works if the value is a number
wtf
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:06 UTC
Your viewmodel is a DefineMap?
Gira Minus
@gKreator
Apr 21 2017 01:07 UTC
and it does not update the map
yes
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:08 UTC
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 UTC
just noticed something crazy
nested properties are bleeding into the parent object of my definemap
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:10 UTC
a-ha. That is crazy
Gira Minus
@gKreator
Apr 21 2017 01:11 UTC
blob
why would this be happening
lol
omg
im giving up
after 3 more hours
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:17 UTC
Weird that there's meow but not driver_name
Gira Minus
@gKreator
Apr 21 2017 01:17 UTC
well technically it wants 123 and it cannot be 123 since it is a number
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:19 UTC
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 UTC
canjs is broken
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:21 UTC
can I see some snippets of your stache?
Gira Minus
@gKreator
Apr 21 2017 01:23 UTC
blob
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:23 UTC
Oh, minor quibble here.
Gira Minus
@gKreator
Apr 21 2017 01:24 UTC
hmm?
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:24 UTC
You have the {($value)} attribute values in magic tags.
Gira Minus
@gKreator
Apr 21 2017 01:24 UTC
omg
:/
fml
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:24 UTC
{{truck.truckNumber}} should be just truck.truckNumber, for example
Gira Minus
@gKreator
Apr 21 2017 01:24 UTC
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 UTC
Is that unblocking you?
Gira Minus
@gKreator
Apr 21 2017 01:28 UTC
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 UTC
:+1:
Gira Minus
@gKreator
Apr 21 2017 01:30 UTC
and ajax works
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:30 UTC
Gooood stuff
Gira Minus
@gKreator
Apr 21 2017 01:30 UTC
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 UTC
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 UTC
ahh true
Brad Momberger
@bmomberger-bitovi
Apr 21 2017 01:33 UTC
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 UTC
and canjs gods, im sorry for ever doubting you
Gira Minus
@gKreator
Apr 21 2017 02:14 UTC
:D