A
A
Aidar2016-07-08 18:09:37
Angular
Aidar, 2016-07-08 18:09:37

How to display an image on a select in angular?

Hello! How to display an image on a select in angular? Those. there is a select, it takes data from an array
. For example, into an array:

$scope.fruits = [
{id: 1,group: "Фрукты",name: 'Яблоко'},
{id: 2,group: "Фрукты",name: 'Апельсин'},
{id: 3,group: "Овощи",name: 'Свекла'},
{id: 4,group: "Овощи",name: 'Картофель'}
];

Those. when you select "Apple", a picture of fruits should appear or, for example, when you select "Beetroot", a picture of vegetables should appear. I just don't know how to attach pictures to the select. Can I shove pictures into an array and load them from there? Give someone a solution. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question