How can i convert text type input to number?
<p>I was confused with filter.</p>

<p>We can use filter attributes as <code>{{ num | number }}</code></p>

<p>why can't we use like this?</p>

<pre><code>&lt;input type="text" name="name" ng-model="num" /&gt;
&lt;input type="number" name="name" ng-model="num | number" /&gt;
</code></pre>

<p>If my approach is wrong. How can i convert <strong>text type input</strong> to <strong>number</strong>?</p>