Connecting and fetching data from mysql using angularjs
Hello and welcome to SO,
I created this diagram to make you feel more comfortable with the object.
As you can see, I haven't mentioned any of the languages, Client, Server, or Database, because the language itself has nothing to do with REST APIs.
Instructions - begginer:
(If you are using PHP, I would recommend SlimFramework, which is lightweight, scalable, easy to start with PHP Framework).
1) Select the server language.
2) Create a database resource.
3) Select the server language.
4) Create 4 scripts, each one one at a time: Create, Read, Update, Delete.
5) Connect the endpoints with each of the scripts, the URL is GET, POST, DELETE, UPDATE.
6) Make sure you can access each of them from the internet (authenticated or not).
7) Once you have verified that the endpoints are working, time to connect Angular:
7a) First try to create buttons for each action and link it to $ http.get, $ http.post, $ http.delete, $ http.put.
7b) Once you start working you can zoom in and use ng-resource or restangular.
PS: I did not provide much information about the codes, because after understanding what I said above, you will understand that it is not very difficult to write code for this.
After completing these steps, you can start with: server-side and client-side authentication, performance, multiple resources and collections, CORS and preflight requests, etc.
Good luck.
source to share