angular server-side - Google Groups

1 downloads 129 Views 202KB Size Report
PhantomJS. (or similar server-side html snapshot generator). Can you change hosting? 1. AJAX request can't return only J
TASK: SINGLE-PAGE WEBSITE REQUIREMENTS: MODEL DATA ARE OBTAINED VIA AJAX REQUESTS (AS JSON) CLIENT-SIDE: ANGULAR SERVER-SIDE: LAMP Do you need crawlable website?

YES

NO

Can you install custom packages on server?

YES

Simply enjoy developing with Angular 

NO

Can you change hosting?

Use #! hasbang urls + PhantomJS

YES

(or similar server-side html snapshot generator)

1. AJAX request have to return JSON + Angular directive i.e. : $scope.users = ;

……

2. Crawling bot will also read JSON data and Angular will compile template on client side

NO

1. AJAX request can’t return only JSON model data

1. forget the AJAX requests

2. server have to generate whole HTML template (i.e. list of users)

2. deal with too many

3. probably you can’t get benefits of Angular directives, because whole template is generated on server-side

page refreshes