Handling data binding in AngularJS Services

前端 未结 3 613
遥遥无期
遥遥无期 2020-12-25 13:47

I\'m trying to figure out how you handle binding properly when my data is stored in a service.

I can get things working if it put the service into the $scope and the

3条回答
  •  [愿得一人]
    2020-12-25 14:38

    I think, even more elegant is to work with promises (see $q.deferred()) and to resolve them asynchronously. In the promise function you can then assign the data to $scope's members.

提交回复
热议问题