You need to sign in to do that
Don't have an account?
Rajiv Kocherla
<aura:iteration>
Hi,
Please look at the following piece of code
<aura:attribute name="NoofHoursStudy" type=" String[]" default="Less than 1 hour, In between 1 to 4 hours, In between 4 to 8 hours, More than 8 hours"/>
<lightning:select label="How many hours do you study in a day?" name="hrsStudy">
<aura:iteration items="{!v.NoofHoursStudy}" var="hrs" >
<option value="{!hrs}" text="{!hrs}">
</aura:iteration>
</lightning:select>
Q) My Question is what exactly the bolded part of piece of code doing? ? Without that i receive an error. Can somebody please tell me what value attribute is doing ?? also what text attribute is doing, and what does exclamation mark in text attribute mean?? also what does exclamation mark for the value of the value attribute mean and what value attribute is doing??
Please look at the following piece of code
<aura:attribute name="NoofHoursStudy" type=" String[]" default="Less than 1 hour, In between 1 to 4 hours, In between 4 to 8 hours, More than 8 hours"/>
<lightning:select label="How many hours do you study in a day?" name="hrsStudy">
<aura:iteration items="{!v.NoofHoursStudy}" var="hrs" >
<option value="{!hrs}" text="{!hrs}">
</aura:iteration>
</lightning:select>
Q) My Question is what exactly the bolded part of piece of code doing? ? Without that i receive an error. Can somebody please tell me what value attribute is doing ?? also what text attribute is doing, and what does exclamation mark in text attribute mean?? also what does exclamation mark for the value of the value attribute mean and what value attribute is doing??
In aura iteration code is using a variable "NoofHoursStudy"(which is also using with '!' mark)
This vairable is iterating using a diffferent variable "hrs", so this is also creating a new variable here(options of select dropdown)
So, to create <Option> for Dropdown, code is using dynamic variable "hrs", so that's why "!" exclamation mark is used.
Please let me know if you have any other queries. :)