title: Best way to create this Angular Directive - from / to date selector directive
body: <p>I have a from / to date selection on my web app as below:</p>
  
  <pre><code>&lt;div class="date-picker-horizontal"&gt;
      &lt;i class="icon-calendar"&gt;&lt;/i&gt; 
      Select Date: 
      &lt;input bs-datepicker type="text" ng-model="fromDate" /&gt; to 
      &lt;input bs-datepicker type="text" ng-model="toDate" /&gt; 
      &lt;a class="btn" ng-click="loadData()"&gt;&lt;i class="icon-refresh"&gt;&lt;/i&gt;&lt;/a&gt;
      &lt;div class="loading" ng-show="isLoading"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need to use this in multiple places in my web app so I created this as a directive and it is working. I pass in the values from the scope like so:</p>
  
  <pre><code>&lt;div ng-controller="myController"&gt;
     &lt;from-to-date-selector data-from-date="fromDate" data-to-date="toDate" data-on-refresh="loadData()" data-is-loading="isLoading" /&gt;
     &lt;from-to-date-selector data-from-date="lastYearsDate" data-to-date="thisYearsData" data-on-refresh="loadYearlyData()" data-is-loading="isYearlyLoading" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The scope of my controller "myController" contains each variable that is passed to the directive ( fromDate, toDate, lastYearsDate, etc. ) and also the functions to load the data ( loadData(), loadYearlyData() ).</p>
  
  <p>I guess I would like to know if this is the right approach ? I'm fairly new to Angular and don't want to start off by getting into bad habits. Is passing in a whole bunch of values to a directive bad practice ?</p>