344840 (10) [Avatar] Offline
#1
Hey Jeremy,

Throughout the book you have used .factory() to share data between controllers.
It would be great if you consider adding somewhere an alternative way of accomplishing this data sharing and compare it to the .factory() (advantages/disadvantages).

I think it would enrich developers options and understanding.
jeremy.wilken (208) [Avatar] Offline
#2
This is a pretty common Angular tactic (there are others, but this technique is clean and simple). Unfortunately the book is already finished and in final rounds of editing, so I'm not allowed to make any major changes to add alternatives at this point.

There are many great posts around the web about how to share data between Angular controllers that can cover it in great detail. I have found that using a factory is likely the best solution for most use cases in my years of writing Angular apps. Here are some good posts that cover more details.

https://thinkster.io/a-better-way-to-learn-angularjs/services
http://www.johnpapa.net/sharing-data-in-an-angular-controller-or-an-angular-service/
http://crudbetter.com/angular-share-data-between-controllers/