Reputation: 14707
How can I clean the value of variable on selecting the input box in angular 2 and angular material.
<div>
<input type="text" placeholder="Search..." [value]="searchValue" [(ngModel)]="variable" >
</div>
export class App {
}
}
Upvotes: 2
Views: 905
Reputation: 3858
You can do this using the following CSS:
input:focus::-webkit-input-placeholder {
color:transparent;
}
input:focus:-moz-placeholder { /* Firefox 18- */
color:transparent;
}
input:focus::-moz-placeholder { /* Firefox 19+ */
color:transparent;
}
input:focus:-ms-input-placeholder {
color:transparent;
}
See the plunk.
Upvotes: 2