AngularJS: Using Shared Service(with $resource) to share data between controllers, but how to define callback functions?

前端 未结 4 750
自闭症患者
自闭症患者 2020-12-11 04:45

Note: I also posted this question on the AngularJS mailing list here: https://groups.google.com/forum/#!topic/angular/UC8_pZsdn2U

Hi All,

I\'m building my fi

4条回答
  •  不知归路
    2020-12-11 05:00

    You should take a look at the $q service, you can do:

    promise.then(callback);
    

    From 1.1.3, you can access promises with $then, for exemple resource.query().$then(callback);

提交回复
热议问题