javascript - How do you send payload data with initial request? -


lets say, example, have page has table list of users. render html table of users, isn't friendly angular. can ajax server data, have wait initial page render , make additional http request, adds additional delay.

is there way send payload data along initial request don't have ajax data , can still use angular binding (e.g. ng-repeat)?

the way access server data without executing javascript have server include data in initial request web page. require using server side language such php, ruby, or asp.net can query data, add web page, , send updated web page in it's inital http resonse.

however, concept undermines purpose of using client side framework such angularjs. angular wants in charge of data access, , recommend letting be. angular doesn't know data didn't retrieve, going have dynamically modify page scripts tell angular data server retrieved. going down dark road not want go down. doing double work.

if concern users see brief delay between page load , initial data loading, have option keep screen blank until initial data loads using things directives ng-cloak , ng-bind. if concerned delays in retrieving data after initial page load, remember full-page http request , full page reload takes longer ajax call updates single part of page.

if don't want using ajax calls, don't want using angularjs.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -