I have a component having multiple values.The multiple values are coming properly in the input text box. I want to show the values selected from the list as lightning pills.
My Component Code is :-
<aura:attribute name="picklistOptsList" type="String[]"/>
<ui:inputSelect multiple="true"
class="multiple"
aura:id="InputSelectMultiple"
change="{!c.onMultiSelectChange}" value="">
<ui:inputSelectOption text="Any"/>
<ui:inputSelectOption text="Open"/>
<ui:inputSelectOption text="Closed"/>
<ui:inputSelectOption text="Closed Won"/>
<ui:inputSelectOption text="Prospecting"/>
<ui:inputSelectOption text="Qualification"/>
<ui:inputSelectOption text="Needs Analysis"/>
<ui:inputSelectOption text="Closed Lost"/>
</ui:inputSelect>
<ui:inputText class="result" aura:id="multiResult" value="{!v.picklistOptsList}" />
My Controller Code is :-
onMultiSelectChange: function(component, event) {
debugger;
var selectedValue= event.getSource().get("v.value");
component.set("v.picklistOptsList", selectedValue);
console.log('you selected :'+selectedValue);
},