0

Is there a way to include in a input placeholder an image and text at the same time?

Something like this mock:

enter image description here

Thanks in advance!

1 Answers1

0

The placeholder can be fixed by adding the placeholder attribute to the input element.

You can also have the placeholder image only show when the value of the input is not equal to null.

See example:

<div class="search-wrapper">
    <input type="text" [(ngModel)]="search" placeholder="Search...">
    <img src="" *ngIf="search != null"/>
</div>    

Its then up to you to position absolute the image into the correct position.

Lewis Browne
  • 904
  • 7
  • 23