84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
接口只能调一次 这点好做利用 service 单例特征 然而怎么同步到 scope 上呢 定义一个方法返回数据吗 但是获取是异步的啊 调用方法的时候不一定就取到数据了啊 还有一种就是把 scope 传参到 service 里吗异步去更新 scope 但是貌似不推荐这么做啊…… 求解决方案~
学习是最好的投资!
I can understand that you need to synchronize, that is, wait for the data to be obtained before calling the method
angular’s promise should be what you want
Post an article at the address:/a/11...
The service layer is only used to request interfaces, and callbacks and data operations are done in the controller
I can understand that you need to synchronize, that is, wait for the data to be obtained before calling the method
angular’s promise should be what you want
Post an article at the address:
/a/11...
The service layer is only used to request interfaces, and callbacks and data operations are done in the controller