Loading data: synchronously or asynchronously?

123 views
Skip to first unread message

bay...@gmail.com

unread,
Nov 27, 2013, 10:32:42 AM11/27/13
to knock...@googlegroups.com
Hello,
I am wondering if it matters for KO wether we load the view model for a page synchronously or with an AJAX call. Do you have any reservations to synchronous loading of initial view model state with a JS variable. What approach would you suggest?

Gunnar Liljas

unread,
Nov 27, 2013, 11:19:10 AM11/27/13
to knock...@googlegroups.com
No, it doesn't matter to KO, but of course you need to be aware that a lot of properties can be empty when loading asynchronously, so you should avoid constructs like "data-bind='text:somePossiblyUnitializedObservable().SubProperty"

Loading initial state from a rendered JS variable is very good, since it speeds things up.

/G


2013/11/27 <bay...@gmail.com>
Hello,
I am wondering if it matters for KO wether we load the view model for a page synchronously or with an AJAX call. Do you have any reservations to synchronous loading of initial view model state with a JS variable. What approach would you suggest?

--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

sriram.ra...@gmail.com

unread,
Jul 2, 2014, 8:49:12 AM7/2/14
to knock...@googlegroups.com, bay...@gmail.com

I have serious issues with knockout.

I am trying to edit  page with pre populated values from drop-downs.

So some times it's pointing it to right values some time not...

i don't know how to resolve this.Please help me out...

Keuller Magalhaes

unread,
Jul 2, 2014, 6:00:58 PM7/2/14
to knock...@googlegroups.com, bay...@gmail.com, sriram.ra...@gmail.com
Hi,

Can you put your snippet code here to check it out ?

Regards.
Message has been deleted

Gunnar Liljas

unread,
Jul 3, 2014, 12:17:45 PM7/3/14
to knock...@googlegroups.com, bay...@gmail.com, sriram.ra...@gmail.com
Please don't reuse old threads. Create a new one, with a code snippet, instead.

/G

sriram.ra...@gmail.com

unread,
Jul 3, 2014, 12:30:13 PM7/3/14
to Keuller Magalhaes, knock...@googlegroups.com, bay...@gmail.com
I placed the code pls look in to it
Reply all
Reply to author
Forward
0 new messages