These are chat archives for canjs/canjs

16th
Jun 2016
Sunil George
@georgesunil81
Jun 16 2016 18:01
Quick question - is there an easy way to do a two-way binding with textarea HTML element!?
Asking since textarea does not have the 'value' attribute!
Thomas Sieverding
@Bajix
Jun 16 2016 18:01
{($value)}=“myVal"
Sunil George
@georgesunil81
Jun 16 2016 18:02
@Bajix will that work with textarea too?
Thomas Sieverding
@Bajix
Jun 16 2016 18:02
should work
Sunil George
@georgesunil81
Jun 16 2016 18:02
Let me check.
@Bajix Yes, it works! Never thought it would work with textarea. Glad that it does.
<textarea class="form-control" rows="10" id="comment" {($value)}="Comment"></textarea>
Thanks @Bajix for your help.
Thomas Sieverding
@Bajix
Jun 16 2016 18:06
Np
Sunil George
@georgesunil81
Jun 16 2016 20:57
Need help with hopefully a quick question - I have a stache template with a "can-click" which looks like it invokes a method. I am trying to find out how does it know which js file to refer to for executing the method!? The below is the snippet containing the can-click -
<a href="javascript:void(0)" can-click="pagination.nextPage"> <i class="fa fa-chevron-right"></i> </a>
So, it is looking for a method called 'nextPage'
I am trying to find out which js file is it referring to.
Any clues how to find the associated .js file that would contain the method 'nextPage'?
Kevin Phillips
@phillipskevin
Jun 16 2016 20:59
it’s looking for pagination in its scope
how does the stache template get rendered?
Thomas Sieverding
@Bajix
Jun 16 2016 21:00
Use ($click) instead of can-click
You probably have a scope issue
Sunil George
@georgesunil81
Jun 16 2016 21:02
Hmmm, thanks @phillipskevin . That gives me a hint. Let me trace it out further.
Sunil George
@georgesunil81
Jun 16 2016 21:15
@phillipskevin just saw your question. The stache template gets rendered via a component inclusion in a parent template.
I mean the snippet that I put above is in a component-template
Not sure if that is helpful to you. But, you suggestion gave me a good hint. I am tracing further...thanks.
Kevin Phillips
@phillipskevin
Jun 16 2016 21:16
ok, so it will look in that components viewModel… then the viewModel of the parent… all the way up to the root of your app… as long as none of the components have leakScope: false
Sunil George
@georgesunil81
Jun 16 2016 21:17
Wow. Thanks @phillipskevin . That helps me a lot with the trace. I am feeling so much better. Thanks a ton.
Sunil George
@georgesunil81
Jun 16 2016 21:23
@phillipskevin. Was able to figure it out at my end. Your inputs above made it happen for me. Thanks again.
Kevin Phillips
@phillipskevin
Jun 16 2016 21:31
great