Monday, April 3, 2017

Angularjs dropdown value is not updating

Ok here is my story. I have one dropdown which is populating value from a JSON object and and it will be a number. But when you taking data from server using $http in it's success function  my drop-down did not updated.  Simply it was blank..


var httpRequest = $http({
            method: 'POST',
            url: "URL",
            data: { Params }

        }).then(
        function successCallback(response) {

            $scope.ApiServiceObject.EntityTemplateId = response.data.d.dropdownvalue;
       

        },
        function errorCallback(response) {

        });


But when I'm trying to set value to my drop-down from a integer property its not working.   So I changed bellow line and everything working fine now. 


 $scope.ApiServiceObject.EntityTemplateId = response.data.d.dropdownvalue.toString()

No comments:

Post a Comment