title: Angular 2 set input max length dynamically
body: <p>I would like to get the max length of an input from a service (do an http call to get the value).</p>
  <p>Is there any way to do it with calling the service only once?</p>
  <pre><code>&lt;input type=&quot;text&quot; [attr.maxLength]=&quot;getMaxLength()/&gt;
  </code></pre>