Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set default value in dynamic dropdown angularjs

$http.post('commandCenter.aspx/allCustomer', {}).then(
                    function onSuccess(response) {
                        $scope.customers = JSON.parse(response.data.d);
                        if ($scope.customers.length === 1) {
                          $scope.relatedTo = $scope.customers[0].CUSTCODE;
                        }
                        console.log($scope.customers); },
                    function onError(response) {
                        console.log('error !!! ');
                    });
 
PREVIOUS NEXT
Tagged: #set #default #dynamic #dropdown #angularjs
ADD COMMENT
Topic
Name
9+9 =