Input directive losing type attribute


I have a text input element in a directive template. When the template is rendered the type attribute is removed. If I make the input type “number”, it works fine. My guess is that in certain cases angular is removing the type=“text” (since it is the default). The only reason it is a problem is that some of the ionic css relies on the type.

Any ideas on how to prevent the type from being stripped? Otherwise, this is a bug in the ionic css.

I was unable to replicate this in a simple codepen. Here is codepen with my directive, but this codepen is not displaying the problem. In my app, it is also inside a tab view.

See the Pen nKJdr by ndudenhoeffer (@AgDude) on CodePen.


It turns out the “text” type was being stripped by a the default settings in grunt-angular-templates, which has a default option to removeRedundantAttributes.