Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
angularjs已选择的值不应出现在json的其他多个下拉列表中_Angularjs_Json_Jsp - Fatal编程技术网

angularjs已选择的值不应出现在json的其他多个下拉列表中

angularjs已选择的值不应出现在json的其他多个下拉列表中,angularjs,json,jsp,Angularjs,Json,Jsp,我需要你的帮助。 我正在使用json中的ng repeat实现多个下拉列表。我希望一旦在一个下拉列表中选择了值,它就不应该出现在另一个下拉列表中。我是新来安格拉斯的。这是我的json。我想要下拉列表中的“数据”和选定的值列索引 $scope.records = [ { "userId": "10", "fisrtname": "Unnati", "lastName": "Chauhan", "dateVal": "22-05

我需要你的帮助。 我正在使用json中的ng repeat实现多个下拉列表。我希望一旦在一个下拉列表中选择了值,它就不应该出现在另一个下拉列表中。我是新来安格拉斯的。这是我的json。我想要下拉列表中的“数据”和选定的值列索引

$scope.records = [
    {
        "userId": "10",
        "fisrtname": "Unnati",
        "lastName": "Chauhan",
        "dateVal": "22-05-2016",
        "columnindex": "1",
        "data": [{value: 1, text: 'USERID'},
            {value: 2, text: 'FIRSTNAME'},
            {value: 3, text: 'LASTNAME'},
            {value: 4, text: 'DOB'}]
    },
    {
        "userId": "20",
        "fisrtname": "Ranju",
        "lastName": "Shinde",
        "dateVal": "21-05-2016",
        "columnindex": "2",
        "data": [{value: 1, text: 'USERID'},
            {value: 2, text: 'FIRSTNAME'},
            {value: 3, text: 'LASTNAME'},
            {value: 4, text: 'DOB'}]
    },
    {
        "userId": "30",
        "fisrtname": "Smruti",
        "lastName": "Modi",
        "dateVal": "20-05-2016",
        "columnindex": "3",
        "data": [{value: 1, text: 'USERID'},
            {value: 2, text: 'FIRSTNAME'},
            {value: 3, text: 'LASTNAME'},
            {value: 4, text: 'DOB'}]
    }];
我的html代码是

 <div ng-controller="multipleDropDown">
        <div ng-repeat= "us in records" >

            <select ng-model="us.columnindex" ng-options="item.value as item.text for item in us.data|arrayDiff:us.data:item.value">
            </select>
        </div>
    </div>

您需要在下拉列表元素中添加以下代码,以避免在更改
ng model
值时递归调用所有三个下拉列表

ng-model-options="{ updateOn: 'change', debounce: { change: 0 } }"

还有一个函数,用于更新
$scope.records
数组的
数据
对象。请看看这个。我想这就是你想要的具体东西。

请帮助我。我真的需要解决方案你能分享你的html代码吗??你好ruhul这是我的html代码我不太明白你的问题。是否要在首次加载时将数据下拉列表设置为
Couluminex
?像这样的?