2016-10-21 1 views
0
<select ng-option="ubrandname as ubrandname.brand for brand in ubrandname track by ubrandname.brand" ng-model="ubrandname"></select> 

ceci est mon dropdownlist pour appeler ensemble dynamique de données de mon js fichierdonnées dynamiques appel avec ng-option dans dropdownlist AngularJS

//brandnamebyid 
      $http.get('/brandinfo.asmx/getbrandname', { 
       params: { 
        log: log, 
        pm: pm, 
        id: $scope.updateparam.Id 
       } 
      }) 

      .then(function (response) { 
       { 
        $scope.brandfunction = response.data.branddetails; 
        $scope.ubrandname = $scope.brandfunction[0]; 
        console.log($scope.ubrandname); 
       } 
      }); 

je pense que je suis incapable d'écrire la syntaxe correcte de ng-options dans ma liste déroulante, quelqu'un peut-il m'aider ici?

Répondre

0

Votre source de données ng-model et ng-option semble identique. S'il vous plaît essayer comme ci-dessous,

<select ng-option="brand as brand.brand for brand in brandfunction track by $index" ng-model="ubrandname"></select> 
0

Essayez cette

<select ng-model="ubrandname"> 
    <option ng-repeat="brandname in brandfunction" value="{{brandname}}">{{brandname}}</option> 
</select>