These are chat archives for canjs/canjs

11th
Jul 2016
Jeremy Miller
@jjm340
Jul 11 2016 03:41
I tried using setTimeout() in the instance init function for a view model but it prevented the component's template from loading...any ideas on how I accomplish a splash screen affect with a delay?
Guido Smeets
@gsmeets
Jul 11 2016 07:08
viewModel: {
  init: function () {
    setTimeout(function () { this.attr( "loaded", true ); }, 5000)
  }
}
template:
{{#if loaded}}
  ...
{{#else}}
  splash
{{/}}
Something like that @jjm340 ?
Danil Radkovsky
@Krakabek
Jul 11 2016 13:52
Hello, everyone
How can I access response headers, put in fixture?
e.g. I have response(200,'success', {foo:'bar'},{baz: 'qux'});
But when I do xhr.getAllResponseHeaders(), I can't see baz header.
Juan Orozco
@Macrofig
Jul 11 2016 19:04
Before I create an issue for this, can someone confirm I'm not crazy? :) It seems like live-binding is broken-ish with latest CanJS. http://jsbin.com/joyofu/edit?js,output
Michael Price
@web-mech
Jul 11 2016 19:25
just a guess but it could be that you’re trying to cross bind a primitive instead of an object
@Macrofig ^
Juan Orozco
@Macrofig
Jul 11 2016 19:28
Interesting. So, instead of binding reload, in your example, I should bind action?
Michael Price
@web-mech
Jul 11 2016 19:29
right, bind to a map instead of a primitive
Juan Orozco
@Macrofig
Jul 11 2016 19:30
That works! So, the interesting thing is, my example works in 2.2.9
So now I'm wondering if this changed behavior is the desired behavior or should it continue to work into 2.3.x? 🤔
Michael Price
@web-mech
Jul 11 2016 19:37
I’m not sure about that bit. I just know thats the way it works in other frameworks
Juan Orozco
@Macrofig
Jul 11 2016 19:37
Word. Thanks for the help!
Michael Price
@web-mech
Jul 11 2016 19:38
np
Dovid Bleier
@dbleier
Jul 11 2016 19:50
when trying to create an algebra obj in my fixture
const algebra = new set.Algebra({
    set.comparators.id("mac")
});
I get this error Unexpected token . on the set.comparators line
Juan Orozco
@Macrofig
Jul 11 2016 19:51
@web-mech I lied... it doesn't work at all in 2.2.9.
Dovid Bleier
@dbleier
Jul 11 2016 19:55
figure it out - should not be in {} -- the can-fixture docs need to be updated https://github.com/canjs/can-fixture
Michael Price
@web-mech
Jul 11 2016 19:56
ah