These are chat archives for canjs/canjs

4th
Feb 2019
qantourisc
@qantourisc
Feb 04 12:43
What could cause connectedCallback not to be called ? V4
I was removing some warnings of wrong use of extend, etc, but i'm not sure how it's related yet. (but that might help)
qantourisc
@qantourisc
Feb 04 13:03
Ok... broken specifically in firefox
Ivo Pinheiro
@ivospinheiro
Feb 04 13:54
@qantourisc are you using the latest version? Are you extending DefineMap for the ViewModel?
qantourisc
@qantourisc
Feb 04 14:21
@ivospinheiro the latest version of canjs4 yes, Tried to get 5 earlier but the CDN seems down/crash atm.
Yes, but since it works in 1 browser and not the other: i suspect I got some bad™ code that's causing problems. Now fixing all the debug info's and seeing what is left after that.
Piyush Sharma
@Piyush5767
Feb 04 14:53
Hi, is it possible to call child function repeadly while we are using each?
for example: i have create a component of ckeditor and used <admin-ckedit vm:attributeId:bind="pageAttributes.ckeditor_attribute_id" vm:value:bind="pageAttributes.attributes.{{name}}" id-name:from="'ck_edit_{{name}}_main'" name:from="'{{name}}'" this:to="ckedits" />
to call it again and again, and its working where as i am using
$('admin-ckedit').each(function(i, ckedit) { console.log(this); ckedit.viewModel().reload(); }); to call all ckeditor viewmodel one by one to further call its reload function
but that is not working properly and giving me error: ckedit.viewModel is not a function
qantourisc
@qantourisc
Feb 04 15:34
@Piyush5767 Assuming I didn't make any reasoning mistakes : ckedit is probably a HTML element. You want can.viewModel(ckedit).reload().
Piyush Sharma
@Piyush5767
Feb 04 15:35
the issue is resolved by using: canViewModel(ckedit).reload();
qantourisc
@qantourisc
Feb 04 15:35
that was quick :p
Piyush Sharma
@Piyush5767
Feb 04 15:35
in canjs3 dom element was loaded by using: import canViewModel from "can-view-model";
qantourisc
@qantourisc
Feb 04 15:42
@ivospinheiro You know the weird bug I coudn't find ? (Worked in Chrome, not in Firefox.) Firefox was beeing "weird" and "crashy", I opened a new browser-tab, POOF it works. :shakes-head:
Ivo Pinheiro
@ivospinheiro
Feb 04 15:44
Rule #1 on software development, when it is not working close all windows (clear cache also), and then open it again, if it persists it is really a bug :P
qantourisc
@qantourisc
Feb 04 16:15
I have been fortunate enough to have worked with buggy browsers in the past, no cache clearing or browser reboot being required.
qantourisc
@qantourisc
Feb 04 17:21
What is the correct way to access something from "window." from a scope (aka: from stache) ?
Kevin Phillips
@phillipskevin
Feb 04 17:40
from a property on your viewmodel