मैंने Angularjs का उपयोग करके मॉडल के लिए एक चुनिंदा बॉक्स बनाया है। चयन बॉक्स विकल्प सही ढंग से लोड होते हैं लेकिन जैसे ही कोई भी विकल्प चुनते हैं, सभी विकल्प चुनिंदा बॉक्स से गायब हो जाते हैं। यह क्या कारण है और मैं अपने विकल्पों को गायब होने से कैसे रोकूं?AngularJS चुनिंदा बॉक्स विकल्प गायब हो जाते हैं जब कोई आइटम चुना जाता है
Plunker लिंक मुद्दे का प्रदर्शन: http://plnkr.co/edit/DolBIN
एचटीएमएल
<html xmlns="http://www.w3.org/1999/xhtml" ng-app>
<head>
<title>Angular Test Prjoect - Home</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<script type="text/javascript" src="Clinic.js"></script>
</head>
<body>
<div ng-controller="ClinicCtrl">
<select ng-options="item as item.start + '-' + item.end + ':' + item.patient.name for item in appointments" ng-model="appointments">
</select>
</div>
</body>
</html>
जावास्क्रिप्ट
function ClinicCtrl($scope) {
$scope.appointments = [
{ start: "900", end: "930", provider: "1", patient: {name:"Allen",dob:"8/12/1977"} },
{ start: "1000", end: "1045", provider: "1", patient: { name: "Allen", dob: "8/12/1971"} },
{ start: "1030", end: "1100", provider: "2", patient: { name: "David", dob: "11/22/1973"} },
{ start: "1100", end: "1145", provider: "2", patient: { name: "Francine", dob: "3/18/1987"} },
{ start: "1230", end: "1530", provider: "3", patient: { name: "George", dob: "4/5/1997"} },
{ start: "1300", end: "1500", provider: "3", patient: { name: "Kirkman", dob: "6/28/1970"} }
];
}
+1, मैं तुम्हें कुछ इस तरह कर सकता है पता नहीं था: 'item.start + '- चयन सूची लेबल के लिए 'item.end +': 'item.patient.name'। –