title: angular2 access ngModel variable from a directive
body: <p>I am trying to build a datetime picker directive like the following.<br>
  <code>&lt;input [(ngModel)]="date1" datetime-picker date-only /&gt;</code></p>
  
  <p>and <code>date1</code> is assigned as a Date, e.g., <code>new Date()</code></p>
  
  <p>When I display this in html, text in input element looks like the following<br>
  <code>Thu Jan 01 2015 00:00:00 GMT-0500</code></p>
  
  <p>I want to display like the following instead<br>
  <code>2015-01-01 00:00:00</code></p>
  
  <p>I want to format date WITHIN a directive using DatePipe instead of showing result from default toString() function.</p>
  
  <p>My question is; "within a directive, how do I access ngModel variable?", e.g., date1, so that I can add toString() method.</p>
  
  <p>If my approach is not right, please advise me.</p>