"Before writing angular-data I used to create fleets of services for my various resources, each performing data management and communicating with a persistence layer." Can someone give me an example of this? I just use $http and populte the $scope models in callbacks so I don't really recognize the problem.
For those writing largish non-trivial apps its essential to separate concerns for maintainability and testability. Controllers and UI logic get separated from domain logic and your Model layer. $scope is no Model layer.
Angular-data: data store and caching for Angular.js
21–30 of 49 posts
Re: Angular-data: data store and caching for Angular.js
#22Anyone know why these high point submissions aren't on the front page? Is Hacker News ghosting/flagging these posts for any specific reason? Sorry to ramble a bit off topic.
Re: Angular-data: data store and caching for Angular.js
#23Re: Angular-data: data store and caching for Angular.js
#24"Before writing angular-data I used to create fleets of services for my various resources, each performing data management and communicating with a persistence layer." Can someone give me an example of this? I just use $http and populte the $scope models in callbacks so I don't really recognize the problem.
For those writing largish non-trivial apps its essential to separate concerns for maintainability and testability. Controllers and UI logic get separated from domain logic and your Model layer. $scope is no Model layer.
It seems more meant ot be used as a caching layer that would wrap you webservice access services.
Re: Angular-data: data store and caching for Angular.js
#25"Before writing angular-data I used to create fleets of services for my various resources, each performing data management and communicating with a persistence layer." Can someone give me an example of this? I just use $http and populte the $scope models in callbacks so I don't really recognize the problem.
A scope only extends as far as a particular controller/service. If you wanted every controller/service to have access to that user's data (eg. that user's ID), you would create a service that would store that data, and then inject that service into each place you need to access the data.
Re: Angular-data: data store and caching for Angular.js
#26Anyone know why these high point submissions aren't on the front page? Is Hacker News ghosting/flagging these posts for any specific reason? Sorry to ramble a bit off topic.
Re: Angular-data: data store and caching for Angular.js
#27Re: Angular-data: data store and caching for Angular.js
#28Re: Angular-data: data store and caching for Angular.js
#29ELI5 why I'd use this in a regular project using say Rails and angular?
Think of this as client side ActiveRecord. It handles queries, relations, and syncing with the back end.
Re: Angular-data: data store and caching for Angular.js
#30I couldn't find anything in the docs about invalidation. Is anybody aware of how to force invalidation of an object/collection?