angular.js - How to plan backend interface calls and encapsulate them into individual Services? ~
天蓬老师2017-05-15 17:12:18
0
2
647
How to plan better to facilitate future maintenance and get full commission service? Or should we create a value to store the names of interface methods and parameters~
My approach is modular, using namespaces and dependency injection For example, the request interface for orders is placed in order.service.js. This granularity can be adjusted to personal preferences
Put the method called by the interface in the service, and then call this method in the controller
If the call of this interface involves other modules, move the calling method of this interface to the next level
My approach is modular, using namespaces and dependency injection
For example, the request interface for orders is placed in order.service.js. This granularity can be adjusted to personal preferences
Put the method called by the interface in the service, and then call this method in the controller
If the call of this interface involves other modules, move the calling method of this interface to the next level
Let me show you the scaffolding I uploaded on github
https://github.com/WuWeiSen/a...