How to handle mapping DB Tables to Angular Display which I think is one of the most common requirements in WebApps ?
There are several factors that needs to be considered .
1)For displaying the records , a 2D JSON would be fine ?
Like for example :
var myList = function($scope){
$scope.foods = [
{name:"Pizza" , price:100},
{name:"Pasta" , price:50},
{name:"Burger" , price:30},
{name:"Pepsi" , price:10},
{name:"Icecream" , price:15}
]
};
And for the refresh the view part , Is it good idea to sent a JSON of Primary IDN's for refreshing the view form Server ?
2) Where should pagination be handled . I think a complete server side pagination is won't take advantage of Angular's front end capabilities like Filter ?
Short data say < 1000 records would probably be better sent to server , While large data like 'search' can be paginated server side would be a good trade off ?
For example :
Table : Student
IDN Name Univeristy Age
1 Mark USC 21
2 ...
3 ...
4 John UFL 21