These are chat archives for canjs/canjs

29th
Dec 2015
Guido Smeets
@gsmeets
Dec 29 2015 00:46
" @justinbmeyer : you could write out the tokenized form https://github.com/canjs/canjs/blob/master/view/stache/system.js#L22 "
meh, I thought that tokenized the template itself, but it's just the defines
I was already doing that, in a -granted- convoluted way.
Guido Smeets
@gsmeets
Dec 29 2015 00:52
oh wait, I'm reading that wrong
Bartek
@apieceofbart
Dec 29 2015 08:28
hi, I'm just going through a guide on official canjs page and found a typo - where could I fix it? should I even bother?
I tried to follow the instructions here but both of the URLs in the Documentation sections are 404
Guido Smeets
@gsmeets
Dec 29 2015 16:48
@justinbmeyer did you ever perf test those intermediates?
I was running some tests, too see if my code was running faster now
but it seems to run roughly at the same speed, with some outlyers into running worse
don't have any sane test workbench though, just running chrome devtools with some console.time / timeEnd 10 times per go
so maybe it's just interference from my laptop that's ruining the results
Adam Tourkow
@atourkow
Dec 29 2015 18:04
@apieceofbart I believe the can js pages are all in github and are .md files. You could fork and do a pull request for the typo.
Bartek
@apieceofbart
Dec 29 2015 18:19
@atourkow you're right let me try that, thanks
Adam L Barrett
@BigAB
Dec 29 2015 18:57
What would be the proper 2.3 way to update a ViewModels property on every input event?
<input ($input)="attr('val', $value)”/> ? (of course that doesn’t work)
Matthew Phillips
@matthewp
Dec 29 2015 19:14
i believe
val('something')
works
val($event.target.value) maybe
James Atherton
@James0x57
Dec 29 2015 19:19
<input ($input)="attr( 'val', %element.value )" />
This message was deleted
Matthew Phillips
@matthewp
Dec 29 2015 19:21
ah, yeah it's %event
I think "val" should be a compute here though
Adam L Barrett
@BigAB
Dec 29 2015 19:21
That worked @James0x57 Thanks. You too @matthewp
Matthew Phillips
@matthewp
Dec 29 2015 19:21
at least I remember us talking about that
val(%element.value) would be nicer if that worked
Adam L Barrett
@BigAB
Dec 29 2015 19:23
Ahh, cool, thanks
Justin Meyer
@justinbmeyer
Dec 29 2015 21:48
@apieceofbart fixing it would be great
the easiest way seeing your changes is to run
./node_modules/.bin/documentjs
in a cloned canjs repo
that should generate a sibling docs/index.html
Adam Tourkow
@atourkow
Dec 29 2015 22:50
Just curious, why aren't the model files kept with the components. It is not usually a 1:1 ratio?
I got pushState working :) Required me to make sure I prefixed all js/stache files with "/" hehe
Adam Tourkow
@atourkow
Dec 29 2015 23:04
Googled: "canjs stealjs" Both top links 404 here and here
Justin Meyer
@justinbmeyer
Dec 29 2015 23:09
@atourkow it's usually not a 1:1 ratio
404s are because we recently moved everything into a single page: http://canjs.com/guides/Using.html
Adam Tourkow
@atourkow
Dec 29 2015 23:12
@justinbmeyer yeah, I know you moved the guides. Hopefully Google picks them up quickly :)
And, ok, if it's not 1:1 that makes more sense to separate
Adam Tourkow
@atourkow
Dec 29 2015 23:33
get: function() { var slug = this.attr('slug'); return Restaurant.findOne({id: slug}); }
var slug = this.attr('slug'); does this.attr('slug') come from the route?
Adam Tourkow
@atourkow
Dec 29 2015 23:39
Oh... nevermind. I was using GET /station/:id and not GET /station/{id}
Adam Tourkow
@atourkow
Dec 29 2015 23:47
In the viewmodel, how do I get the slug from can.route(':page/:slug', { slug: null }); to use in findAll/One ?