Input with the date of the respective day, without being able to be edited


I need an input to come with the date of the respective day, for example today: 11/17/2015, tomorrow 11/18/2015. This input can not allow edits.

My code looks like this:

<label class="item item-input">
    <span class="cinza input-label">Data:</span>
    <input class="cinza" type="date">
asked by anonymous 17.11.2015 / 11:40

1 answer


You can assign a variable with the current date in the value of the input, and mark it as readonly not to be edited.

<input class="cinza" readonly type="date" value="{{data| date:'dd-MMM-yyyy'}}">

In controller, $ = new Date();

17.11.2015 / 11:52