title: md-max date working but getting this angular error as soon as I am setting md-max-date
body: <p>I am trying to set a max date of today like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>My controller:
  
  vm.maxDate= maxDate;
  function maxDate() {
      return new Date((new Date()).getFullYear(), (new Date()).getMonth(), (new Date()).getDate());
  }
  </code></pre>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;md-datepicker
               md-placeholder="Date of Creation"
               md-max-date="myCtrl.maxDate()"
               ng-model="myCtrl.form.startDate"&gt;
  &lt;/md-datepicker&gt;
  </code></pre>
  
  
  
  <p>It is working as expected and user is not able to select anything after maxDate. But as soon as I write md-max-date="myCtrl.maxDate()" in my html, I get this angular error. I don't know why this is happening. Any help will be appreciated. Thanks</p>
  
  <p>This is the link to the error
  <a href="https://docs.angularjs.org/error/$rootScope/infdig?p0=10&amp;p1=%5B%5B%7B%22msg%22:%22fn:%20function%20(c,e,f,g)%7Bf%3Dd%26%26g%3Fg%5B0%5D:a(c,e,f,g);return%20b(f,c,e)%7D%22,%22newVal%22:%222017-06-18T04:00:00.000Z%22,%22oldVal%22:%222017-06-18T04:00:00.000Z%22%7D%5D,%5B%7B%22msg%22:%22fn:%20function%20(c,e,f,g)%7Bf%3Dd%26%26g%3Fg%5B0%5D:a(c,e,f,g);return%20b(f,c,e)%7D%22,%22newVal%22:%222017-06-18T04:00:00.000Z%22,%22oldVal%22:%222017-06-18T04:00:00.000Z%22%7D%5D,%5B%7B%22msg%22:%22fn:%20function%20(c,e,f,g)%7Bf%3Dd%26%26g%3Fg%5B0%5D:a(c,e,f,g);return%20b(f,c,e)%7D%22,%22newVal%22:%222017-06-18T04:00:00.000Z%22,%22oldVal%22:%222017-06-18T04:00:00.000Z%22%7D%5D,%5B%7B%22msg%22:%22fn:%20function%20(c,e,f,g)%7Bf%3Dd%26%26g%3Fg%5B0%5D:a(c,e,f,g);return%20b(f,c,e)%7D%22,%22newVal%22:%222017-06-18T04:00:00.000Z%22,%22oldVal%22:%222017-06-18T04:00:00.000Z%22%7D%5D,%5B%7B%22msg%22:%22fn:%20function%20(c,e,f,g)%7Bf%3Dd%26%26g%3Fg%5B0%5D:a(c,e,f,g);return%20b(f,c,e)%7D%22,%22newVal%22:%222017-06-18T04:00:00.000Z%22,%22oldVal%22:%222017-06-18T04:00:00.000Z%22%7D%5D%5D" rel="nofollow noreferrer">Link To Error</a></p>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>Error: $rootScope:infdig
    Infinite $digest Loop</p>
    
    <p>10 $digest() iterations reached. Aborting!
    Watchers fired in the last 5 iterations: [[{"msg":"fn: function (c,e,f,g){f=d&amp;&amp;g?g[0]:a(c,e,f,g);return b(f,c,e)}","newVal":"2017-06-18T04:00:00.000Z","oldVal":"2017-06-18T04:00:00.000Z"}],[{"msg":"fn: function (c,e,f,g){f=d&amp;&amp;g?g[0]:a(c,e,f,g);return b(f,c,e)}","newVal":"2017-06-18T04:00:00.000Z","oldVal":"2017-06-18T04:00:00.000Z"}],[{"msg":"fn: function (c,e,f,g){f=d&amp;&amp;g?g[0]:a(c,e,f,g);return b(f,c,e)}","newVal":"2017-06-18T04:00:00.000Z","oldVal":"2017-06-18T04:00:00.000Z"}],[{"msg":"fn: function (c,e,f,g){f=d&amp;&amp;g?g[0]:a(c,e,f,g);return b(f,c,e)}","newVal":"2017-06-18T04:00:00.000Z","oldVal":"2017-06-18T04:00:00.000Z"}],[{"msg":"fn: function (c,e,f,g){f=d&amp;&amp;g?g[0]:a(c,e,f,g);return b(f,c,e)}","newVal":"2017-06-18T04:00:00.000Z","oldVal":"2017-06-18T04:00:00.000Z"}]]</p>
  </blockquote>