We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

how to create syncfusion dropdownlist in angularjs

Hi,

I am using syncfusion dropdownlist. I want to create a dropdownlist for blood group in my form. How can I do that in angularjs?

<input type="text" ej-dropdownlist e-datasource="BloodGroup_List" e-value="Name">

In my controller I have written,

$scope.bloodgroup = [{ "Id": "1", "Name": "O+" },
                                  { "Id": "2", "Name": "O-" },
                                  { "Id": "3", "Name": "A+" },
                                  { "Id": "4", "Name": "A-" },
                                  { "Id": "5", "Name": "B+" },
                                  { "Id": "6", "Name": "B-" },
                                  { "Id": "7", "Name": "AB+" },
                                  { "Id": "8", "Name": "AB-" }];

    $scope.BloodGroup_List = $scope.bloodgroup;

The above code is not working, where am I wrong?



1 Reply

SN Sasikala Nagarajan Syncfusion Team March 4, 2015 12:05 PM UTC

Hi Tejaswini,

Thanks for using Syncfusion Products,

We have analyzed your query and code snippet. We suspect that the issue may be caused due to missing of text field in data source. If you want to use Name field values in dropdown list text then you have to map the “Name” field as Text field.

Please refer the below code snippet

[html]

<input type="text" ej-dropdownlist e-datasource="BloodGroup_List" e-value="Name" e-fields-text="Name" } />

For your convenience we have prepared the simple sample based on this. Please get the sample from below location

Sample

Please use this modified code in your sample to resolve the issue and let us know if you have any further queries.

Regards,

Sasikala Nagarajan



Loader.
Live Chat Icon For mobile
Up arrow icon