Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using select2 plugin for dropdown list on angularjs application. I want to show text both left and right.

I want to show Firstname and lastname to the left side and email to the right. Can you please help. Thanks in advance.

What I have tried:

<select ng-model="selEmployee" id='selUser' name="selEmp" ng-disabled="currentmode == 'edit' || currentmode=='view'">
    <option ng-repeat="employee in employees" value="{{employee.Ldap}}">
           {{employee.FirstName}} {{employee.LastName}} ({{employee.Email}})
    </option>
    <option value="" style="display:none">Please select</option>
</select>
Posted
Updated 5-Nov-19 17:42pm
Comments
Andy Lanng 23-Oct-19 11:22am    
There's not a lot we can tell from your code snippet. If your issue was a logic problem then a code snippet is handy, but for html design it's more tricky. We have no idea what your css says or how the styles are set in the snippert. You will need to show us the issue.
Try looking at https://jsfiddle.net/ where you can add your code, recreate the issue and ask for help in an area that we can look at and try our fixes. I think everyone here trusts jsfiddle so you can feel free to post a link here.
I hope that helps

1 solution

Hello,

I think dropdown binding problem is there :


Select a type


You can try your code according to above example
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900