These are chat archives for canjs/canjs

8th
Jun 2016
Paul Tichonczuk
@tracer99
Jun 08 2016 16:40
moving mustache to stach. Had a scenerio where in an EJS template, I was including a mustache template <%== can.view.render(this.search.control.noteFragPath, this); %> This worked fine with mustache. With Stache it outputs [object DocumentFragment]
the variable above references the path to a statch template
Paul Tichonczuk
@tracer99
Jun 08 2016 16:48
Is ther esomething I should be doing different?
Kevin Phillips
@phillipskevin
Jun 08 2016 17:13
what does it look like in stache?
Matthew Phillips
@matthewp
Jun 08 2016 17:30
In Stache helpers return a document fragment, not a string
Paul Tichonczuk
@tracer99
Jun 08 2016 18:25
so is it not possible to include a stache template this way?
Matthew Phillips
@matthewp
Jun 08 2016 18:26
i'm not sure, what is this doing?
is noteFragPath a url?
is this loading the view?
Paul Tichonczuk
@tracer99
Jun 08 2016 18:32
noteFragPath is a url
and it returns a documentfragment
I figured it out
<div class="note" <%= (el) -> el.grab(can.view(this.search.control.noteFragPath, this)) %>> </div>
seems dirty though
but it works
Matthew Phillips
@matthewp
Jun 08 2016 18:36
that's not statche though
I thought you were converting mustache to stache?
no?
Paul Tichonczuk
@tracer99
Jun 08 2016 18:40
the container is EJS... the template I'm trying to include is a stache
it used to be a mustache file
we're slowly moving our EJS files to STACHE.... but in the meantime we had a bunch of mustache files and I used the script I asked you about yesterday to convert them all
when it was a mustache file, <%== can.view.render(path_to_template, this); worked
but when the template was a stache file it would only output [object DocumentFragment]
this is within an EJS file
Gregg Roemhildt
@roemhildtg
Jun 08 2016 18:50
I'm working with can-connect-supermap. It seems that when two requests are made to the same connection at the same time, they are attempted to be combined, but the combined paramters are not working with my rest api. Can this behavior be avoided?
Gregg Roemhildt
@roemhildtg
Jun 08 2016 19:12
There are multiple requests that look similar to this: filter[objects]:[{"name":"feature_id","op":"equals","val":"1"}], page[number]=1 and the only request that actually gets sent looks like this: filter[objects]:[{"name":"feature_id","op":"equals","val":"1"},{"name":"feature_id","op":"equals","val":"2"}], page[number]=1 So its combining my filters, which throws a 404 on the rest api I'm using
Thomas Sieverding
@Bajix
Jun 08 2016 20:39
Do call expressions have the ability to pass in arguments?
Gregg Roemhildt
@roemhildtg
Jun 08 2016 20:52
@Bajix Yes, I've done things like this and it works: {{method(key)}}
I think you can also do {{method key}} for the same result
Thomas Sieverding
@Bajix
Jun 08 2016 20:53
key?
Gregg Roemhildt
@roemhildtg
Jun 08 2016 20:53
well, key would be the variable you're passing
Thomas Sieverding
@Bajix
Jun 08 2016 20:54
I’m using this for dragging so ($dragmove)=“dragHandler(~position, %el, %ev, drag)"
The normal args are el, ev, drag
Right now I have no way of passing drag, which is an argument added by the processor
Gregg Roemhildt
@roemhildtg
Jun 08 2016 20:56
For events I've done something like ($click)="clickHandler"
Thomas Sieverding
@Bajix
Jun 08 2016 20:57
Yea, but then I have no way of adding in the compute to give my handler context
Multiple things are draggable here, and the compute is used to essential give the event handlers callbacks for updating scope
Gregg Roemhildt
@roemhildtg
Jun 08 2016 21:03
Ah, I see. When I just use the name of the handler, it passes 3 arguments.
0:Map
1:jQuery.fn.init[1]
2:jQuery.Event
I think the first argument would be the scope of the current element that was clicked (or dragged)
Kevin Phillips
@phillipskevin
Jun 08 2016 21:10
you can use %element and %event as shown here: https://canjs.com/docs/can.stache.key.html
what is drag added by?
This message was deleted
^ @Bajix
Thomas Sieverding
@Bajix
Jun 08 2016 21:41
@phillipskevin Drag is added by the processor
Kevin Phillips
@phillipskevin
Jun 08 2016 22:19
sorry, not sure what that means exactly