title: how can I compare values of two fields for validation in angular 2+ formbuilder
body: <p>I am learning angular ionic and currently attempting to use the angular forms, FormGroup, and FormBuilder features to validate some form data. </p>
  
  <p>I have four fields that I would like to validate in relation to one another, but I am not sure how to write a validator that can see the value of other fields.</p>
  
  <p>The relevant fields are: </p>
  
  <p><code>startDate, startTime, endDate, endTime.</code></p>
  
  <p>Because these are ionic datetime inputs, they are always going to be in "ISO 8601" format. So example values might be: </p>
  
  <pre><code>startDate: "2018-03-28"
  startTime: "18:52"
  </code></pre>
  
  <p>My goal is to validate each of these so that they are valid if the start time and date is before the end time and date. For example all four fields are valid when:</p>
  
  <pre><code>startDate is "2018-03-28",
  startTime is "14:30",
  endDate is "2018-03-28", and
  endTime is "18:00"
  </code></pre>
  
  <p>And all four fields are invalid when, for example:</p>
  
  <pre><code>startDate is "2018-03-28",
  startTime is "14:30",
  endDate is "2018-02-24", and
  endTime is "23:00"
  </code></pre>
  
  <p>How can I go about comparing the values of these fields using the angular form features? </p>
  
  <p>Any help would be greatly appreciated! </p>