title: Open Pikaday in a AngulasJS directive
body: <p>It's being difficult to display the Pikaday in a AngularJS directive. For exemple:</p>
  
  <p><strong>index.html:</strong></p>
  
  <pre><code>&lt;my-directive&gt;&lt;/my-directive&gt;
  </code></pre>
  
  <p><strong>controller.js</strong></p>
  
  <pre><code>MyApp.directive('myDirective', function(){
      return{
          restrict: 'E',
          templateUrl: ".../my-directive.html",
      };
  });
  </code></pre>
  
  <p><strong>my-directive.html:</strong></p>
  
  <pre><code>&lt;input  id="view_service" type="text" readonly&gt;
  &lt;div id="view_service_cont"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>Pikaday config:</strong></p>
  
  <pre><code>const view_datepiker = new Pikaday({
      field: document.getElementById('view_service'),
      container: document.getElementById('view_service_cont'),
      format: 'DD/MM/YYYY',
      firstDay: 1,
      minDate: new Date(2017, 0, 1), //Será necessário automatizar a data do calendário
      maxDate: new Date(2019, 12, 31),
      yearRange: [2017,2019],
      onSelect: function() {
          $scope.reset_pax();
          $scope.$digest();
          $scope.sale_form.date_selected = view_datepiker.getDate();
          //$('#datepicker').css('border-color','#78FA89');
          //$('#pax_num_container').css('border-color','#cccccc');
      },
      i18n: {
                  previousMonth : 'Último mês',
                  nextMonth     : 'Próximo mês',
                  months        : ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
                  weekdays      : ['Domingo','Segunda-Feira','Terça-Feira','Quarta-Feira','Quinta-Feira','Sexta-Feira','Sábado'],
                  weekdaysShort : ['Dom','Seg','Ter','Qua','Qui','Sex','Sab']
              },
      disableDayFn: function(theDate) {
          theDate = theDate.toISOString().split('T')[0];
          if ($scope.current_service.availabilities.hasOwnProperty(theDate)) {
              return 0;
          }else {
              return 1;
          }
      }
  });
  </code></pre>
  
  <p>When I tested the <strong>input</strong> directly in the <strong>index.html</strong>, it worked fine. But now I have created this directive to make the things simpler and when I click in the  field the datepiker does not show up.</p>
  
  <p>Does anybody know how to show the Pikaday in a AngularJS directive?</p>