In my demo, I have a small setup.
Essentially, it consists of a select
element with the following data:
address: {
select: {
code: "0",
name: "Select proof of address"
},
letter: {
code: "1",
name: "Letter"
},
photograph: {
code: "2",
name: "Photograph"
}
}
Here is how the select
looks like:
<select ng-model="current.addressCode" ng-options="value.code as value.name for (key,value) in student.address"</select>
Questions:
Question #1 - Reviewing the Ng documentation -
So, I attempt to compare
value.code as value.name for (key,value) in student.address
with the second line (which seems most suitable)
select as label for (key , value) in object
What does this mean?
value.code
maps to select
???
An HTML select
element has an option
tag with attributes value
and inner text like this:
<option value="volvo">Volvo</option>
that's all.
What interpretation should be made from the documentation?
Question #2
How can I connect this object of mine to a regular and comprehensible value,text
select?
(I desire the code
to represent the value
and the name
to serve as the text
)
At present, there doesn't appear to be any value visible in the DOM: