Recently, the author is doing a project: using AngularJS, so as to achieve the front-end and background data docking. This is the first time to do the front-end and background data docking work, so encountered a lot of problems. In these questions, the author summarizes how to achieve the front-end and the background of the data docking method, I hope to share with you.
before starting the front and back-end data docking, the first thing to do is to do the following:
1, first to understand where the page needs to provide data (that is, where to connect the interface)
PS: Obviously, the data in the table is to send the request to the background and get the data that the page needs to display from the database.
2. To understand the meaning of each field in an interface
PS: In general, front-end workers can be based on their English translation, know the meaning of each field
3. To understand the meaning of each field in a database, the relationship between a database table and a field in a database table
This is a table of every database:
Here is the user table:
PS: You can see from the user table, some fields of data is replaced with simple numbers, however, in fact, these "number" field has its corresponding data list, these numbers in its corresponding list has its corresponding meaning.
Cases:
Field Grade
4, to know clearly is directly from the background to obtain data (no need to pass the parameters), or to send data to the background to obtain the data behind the station (to pass the parameter)
Cases:
This is a need to pass the argument:
This does not require a reference:
Data docking of front-end and backstage via Angularjs (I.)