These are chat archives for canjs/canjs

20th
Apr 2017
Mohamed Cherif Bouchelaghem
@cherifGsoul
Apr 20 2017 09:12
@phillipskevin it's fine now
Gira Minus
@gKreator
Apr 20 2017 13:57
@phillipskevin Hey how come this is not working? http://jsbin.com/dibiqut/edit?js,console,output
Gira Minus
@gKreator
Apr 20 2017 14:09
i tried quite a few things :/
Jeroen Cornelissen
@jeroencornelissen
Apr 20 2017 14:17
@gKreator try something like:
post: {
    Type: Post,
    get: function(){
      return {
        id: 123,
        userId: 1,
        title: 'test',
        body: 'testing'
      };
    }
  },
Gira Minus
@gKreator
Apr 20 2017 14:35
what if the get value had an ajax call in it?
Gregg Roemhildt
@roemhildtg
Apr 20 2017 14:48
Use an async getter
Kevin Phillips
@phillipskevin
Apr 20 2017 14:48
not sure exactly what you want it to do, but it’s erroring because post is undefined
which you can fix with an {{#if post}}
Gira Minus
@gKreator
Apr 20 2017 17:22
i was going to create a can-connect that on page load it gets the post_id, then sends an ajax request and fills itself out
i think i saw something similar on bitballs
Gira Minus
@gKreator
Apr 20 2017 17:32
@phillipskevin this is a more complete example http://jsbin.com/dibiqut/edit?js,console,output
blob
that worked
nice
thanks @phillipskevin it was that {{#if post}} that was needed
Kevin Phillips
@phillipskevin
Apr 20 2017 18:32
:thumbsup: