0
<input type = "text" (focus)="this.type='date'">

Changing the input type when the user focuses on input field, default type is text.

For example this works in plain javascript, the type remains as text until the user moves the cursor inside the input field

<input type = "text" onFocus="this.type='date'"> 
yerakaso
  • 21
  • 3

1 Answers1

0

You are using the wrong syntax of focus event, try to use it in an Angular way, like below mentioned -

<input placeholder="Select Date" type = "text" #inp (focus)="inp.type='date'"> 

Working Example

Pardeep Jain
  • 71,130
  • 29
  • 141
  • 199