These are chat archives for canjs/canjs

23rd
Jun 2016
qantourisc
@qantourisc
Jun 23 2016 10:48
is there a way to access a HTML element in the current rendered-template ?
Julian
@pYr0x
Jun 23 2016 11:10
$(this.el).find(....)
qantourisc
@qantourisc
Jun 23 2016 11:38
I meant from the viewModel scope
PS it's ok if I have to bind in from the template
Julian
@pYr0x
Jun 23 2016 11:54
this.element
is the element of the component
that you can find a html element inside by using jquerys find
qantourisc
@qantourisc
Jun 23 2016 12:15
In which scope ? viewmodel scope of the componenent doesn't has thid
qantourisc
@qantourisc
Jun 23 2016 12:21
ow viedModel constructor has the option to pass this info, so I should just set it there, thanks, sort of
Paul Tichonczuk
@tracer99
Jun 23 2016 14:35
@daffl Do you have any insite into my above problem? I remember you were the one who helped me setup can-compile originally
qantourisc
@qantourisc
Jun 23 2016 15:57
Is there a sane way to use hyperlinks in a page without causing a reload ? or should all links get a onclick threadment ?
qantourisc
@qantourisc
Jun 23 2016 16:15
Sometime <a href="/url/newlocation"> works, sometimes it reloads the page ?
qantourisc
@qantourisc
Jun 23 2016 16:45
(could be my browser is so bogged down/slow it runs into some weird bordercase in wich the browser responds before the Javascript cause after browser restart it keeps working)
David Luecke
@daffl
Jun 23 2016 18:57
@tracer99 What is the problem?
Paul Tichonczuk
@tracer99
Jun 23 2016 18:59
See thread with Matthew starting here https://gitter.im/canjs/canjs?at=576ab2de6c39b965695f8b63
TLDR; using can-compile, the compiled bundle for views has it's own steal wrapper and dependancies. This seems to break stache.helpers from working on those templates
David Luecke
@daffl
Jun 23 2016 19:06
Are you using Steal?
If so, it probably would make more sense to use its loader and compiler for views.
Paul Tichonczuk
@tracer99
Jun 23 2016 20:56
@daffl yes I am. How do I set that up?
when I build with steal, it doesn't do anything with the templates
Paul Tichonczuk
@tracer99
Jun 23 2016 21:21
@daffl I think the issue may be that most of our code uses the transitional can.Control structure not can.Component so we don't import templates.
David Luecke
@daffl
Jun 23 2016 22:27
Well you could create your own wrapper for the file can-compile creates.
Or it looks like you did but it seems to conflict with something?