These are chat archives for canjs/canjs

4th
Jan 2017
Gira Minus
@gKreator
Jan 04 2017 00:39
Ohh yeah, doesnt http://canjs.com/doc/can-jquery.html effect the event bindings?
justthismorning
@justthismorning
Jan 04 2017 16:26
While looping over an array in a stache file, is there any way to pass the %index to can.data?
I have the following code and need to access the index value on click.
{{#each ./pages}}
          <button {{data 'button' %index}}>{{%index}}</button>
 {{/each}}
<button ($click)="myFunc ( %context, %element )">
Or just add the index as an attribute of the html element
justthismorning
@justthismorning
Jan 04 2017 17:12
Thanks. That works
Gira Minus
@gKreator
Jan 04 2017 18:33
@matthewp canjs/can-view-import#18 are you talking about can-component 3.0.4?
Matthew Phillips
@matthewp
Jan 04 2017 18:37
can-view-import 3.0.4
Gira Minus
@gKreator
Jan 04 2017 18:41
umm I dont even have can-view-import in my package.json
Matthew Phillips
@matthewp
Jan 04 2017 18:42
you might get it through steal-stache
if you're using that
Gira Minus
@gKreator
Jan 04 2017 18:42
how does this project even work then? is it finding can-view-import from a dependecy or something?
Matthew Phillips
@matthewp
Jan 04 2017 18:43
yeah
Gira Minus
@gKreator
Jan 04 2017 18:43
yeah i am
yeah makes sense
thanks
Matthew Phillips
@matthewp
Jan 04 2017 18:43
try npm ls can-view-import
which should show its version
Gira Minus
@gKreator
Jan 04 2017 18:45
yeah i just re-installed my node_modules so it is version 3.0.4. let me see if it logs errors
blob
blob
still the same issue, it crashes with no errors when trying to get properties of undefined variables
Matthew Phillips
@matthewp
Jan 04 2017 18:50
ok, a bug then
i'll try and simulate it
Gira Minus
@gKreator
Jan 04 2017 18:51
yeah let me see if i can make a jsbin on this, this would be an awful thing if i did something 4k lines ago that does this lol
Gira Minus
@gKreator
Jan 04 2017 18:59
it works here: http://jsbin.com/horutih/edit?html,js,output but its probably do to it being a different version of canjs or something?
i will try this on bitballs later tonight
Gira Minus
@gKreator
Jan 04 2017 19:11
@matthewp Have you ever had this bug where can-view-import fails if the web app's tab is not fucused?
this might be tied in... i noticed one day that if click on another tab and use the console to refresh the app's tab... can-view-import fails
and i dont get any errors
so if i open my app in a new tab with a link and it is not automatically focuses... it pretty much crashes