V
V
Vladimir Golub2016-12-12 16:08:40
Angular
Vladimir Golub, 2016-12-12 16:08:40

Why is the full item written in ng-model and not item.value?

Here is the code in view

<select ng-model="mode" ng-options="item.display for item in options track by item.value"></select>

options code:
$scope.options =
        [{ display: "Таблица", value: "table" },
        { display: "Список", value: "list" },
        { display: "Список с маркерами", value: "budges" }];

Why is the whole item written to mode, and not just item.value. After all, I enter it into the value?
PS Don't blame scope. I know ControllerAS

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2016-12-12
@RazerVG

item.display for item.value ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question