首页 > 解决方案 > 在下拉列表中获取隐藏值

问题描述

我正在使用下拉菜单,它应该使用 ng-option 在我的对象中显示列表。我在下拉列表中获得四个项目的列表,我无法在下拉列表中看到项目

 <select class="" ng-model="vendor.termMaster.termTypeMaster.id" ng-options="t.id as t.terms for t in fetchTermTypeList">
                                                            <option value="">-- Please select --</option>

以上是我所做的html代码示例。

    $scope.fetchTermType= function(){

        vendorsList_Service.fetchTermType().then(function(response){

            $scope.fetchTermTypeList=response.data;
            console.log($scope.fetchTermTypeList);

            $(".loader").fadeOut("slow");
        },function(response){
            $(".loader").fadeOut("slow");
        }); 
    };

$scope.fetchTermType();

这是我的控制器

标签: htmlangularjstagsng-optionsangularjs-ng-options

解决方案


推荐阅读