I am using angular material in an angular 2 project.
I want to put a static image (html element) in the selected value of mat-select.
But i didn't find a solution.
Can someone help me?
相关问题
- Views base64 encoded blob in HTML with PHP
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
when it comes to this or similar situation, I did it that:
of course, inside tags
<mat-select-trigger>
and ` can be any tags as well img, and they work !!By simply adding
<img>
tag inside<mat-option>
. For the selected option usengClass
to set the image as background. You must use one class by option:HTML
CSS:
DEMO