Amidamaru's avatar

Can AngularJS 2 work with a JSON fetched table?

I am fetching the tables from the server using JSON and converted the files into a file. The html contains the records saved to the file.

I want to use AngularJS and do some pagination and ajax search. My question is, can Angularjs2 worked with this kind of html table that was using JSON ?

0 likes
9 replies
primordial's avatar

@Amidamaru Not sure I understand you correctly. Your API should respond with a JSON encoded data which can be easily parsed by Angular/2.

Are you returning a JSON encoded HTML table?

1 like
Amidamaru's avatar

@primordial At the moment, i am returning a json encoded html table. i'm trying to use angular2 for pagination and search sort.

primordial's avatar

@Amidamaru I would suggest pagination should occur server side, for scalability. Your API is best returning pure JSON, let Angular handle the HTML formatting.

1 like
Amidamaru's avatar

@primordial When you say pagination should occur server Side. Can you give an example of what kind of technique is this. Is this node js or what? Thanks.

sawadikan023's avatar

Q微信790042814办理加拿大大学毕业证+成绩单、回国人员证明、教育部真实认证

Amidamaru's avatar

@primordial Thank you. I'm having an idea of what you mean. My project is a fresh install and uses packages.

Please or to participate in this conversation.