title: Laravel/Angular: passing data within php page to angularjs
body: <p>I have the following laravel html/blade page and i want to pass in a <strong>storeid</strong> that then can get picked up via angular to then use to get and do some workings with.</p>
  
  <p>Below is how i am accomplishing it NOW but is there a better way to produce the same?</p>
  
  <p><strong>Blade Partial</strong></p>
  
  <pre><code>&lt;div ng-controller="storeChartCtrl" data-storeid="{{ $store['id'] }}"&gt;
      &lt;p&gt;{{ $store['name'] }} Sales&lt;/p&gt;
      ...
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Angular Ctrl</strong></p>
  
  <pre><code>.controller('storeChartCtrl', ['$scope', 'Store', function($scope, Store){
      //-- get the requested store sales
      var storeid = JQ('#storeChart').data('storeid');
  
      $log.info(storeid);
      ....
  </code></pre>
  
  <p>This currently works and i get my storeid value so i can then send to my factory to get the data.</p>