title: Pass datetime from angular $http.get request to Web API 2 controller
body: <p>I have a web API 2 controller:</p>
  
  <pre><code>[HttpGet]
  [Route("api/MyRoute/{date:datetime}")]
  public IHttpActionResult Get(DateTime date)
  {
      return Ok(date);
  }
  </code></pre>
  
  <p>And an angular $http get call:</p>
  
  <pre><code>$http.get("/api/MyRoute/" + new Date());
  </code></pre>
  
  <p>This doesn't work, I get a 404 error.</p>
  
  <p>I also get this error after the 404: </p>
  
  <p>XMLHttpRequest cannot load <a href="http://localhost:2344/api/MyRoute/2017-06-28T00:00:00.000Z" rel="noreferrer">http://localhost:2344/api/MyRoute/2017-06-28T00:00:00.000Z</a>. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. </p>
  
  <p>But if I change the parameter to anything but a date it works.</p>
  
  <p>I've tried new Date().toISOString() and that does that same.</p>
  
  <p>So how do I pass a date from Angular to a Web API controller?</p>