title: AngularJS using $rootScope as a data store
body: <p>I have an idea for my AngularJS app and I'm curious if the AngularJS community would consider it okay to do it this way. In short, I am connecting to a data API and displaying my results on the page.</p>
  
  <p>I have created an AngularJS service that creates a data store on <code>$rootScope.DataStore</code>. I also have a service method that updates the DataStore with the data returned from an API endpoint. If I request the "products" API endpoint from inside my controller with <code>DataStore.update('products')</code>, this would update <code>$rootScope.DataStore.products</code> with my product data.</p>
  
  <p>Now, in the view/partial, all I need to do is say <code>ng-repeat="product in DataStore.products"</code> to show my data, and it doesn't matter what controller scope I am in. So, in essence my DataStore is my single source of truth.</p>
  
  <p>What I feel like I gain from this method is easy to follow semantics and minimal controller coding. So, anytime the DataStore is updated, anything that's bound to DataStore also gets updated.</p>
  
  <p>Would this put too much load on the <code>$rootScope</code> digest cycle, or is this just an odd way to do it? Or is it a totally awesome way? :) Any comments are welcome.</p>