1
Answer

Don't Fill Data to dropdown list in angularjs!

ali ramezani

ali ramezani

7y
149
1
I write this code, but not work!!
please help me.
 
 
Controller:
(function () {
appModule.controller('education.views.students.createOrEditModal', [
'$scope', '$window','$uibModalInstance', 'abp.services.app.student', 'studentId', 'abp.services.app.city', 'uiGridConstants',
function ($scope, $window, $uibModalInstance, studentService, studentId, cityService, uiGridConstants) {
var vm = this;
vm.saving = false;
vm.student = null;
vm.selectedCity = null;
vm.Cities = [];
vm.GetValue = function () {
var CityId = vm.selectedCity.Id;
var CityName = vm.selectedCity.Name;
//console.log(CityId, CityName);
cityService.getCities({
}).then(function (result) {
vm.Cities = result.data;
//console.log(vm.Cities);
});
};
cshtml:
<div ng-app="appModule">
<div ng-controller="education.views.students.createOrEditModal">
<select ng-model="selectedCity" ng-options="City as City.name for City in vm.Cities track by City.Id" ng-change="vm.GetValue()">
<option value="">Select City</option>
</select>
<br />
@*selected Value is : {{selectedCity}}*@
</div>
</div>

Attachment: Problem_Code.zip

Answers (1)
0
Reena Sajith

Reena Sajith

NA 88 0 18y
Hi, why r u assigning the string line with first and second line at a time /Read the 1st line of recycle.txt string line = sr.ReadLine(); //Read the 2nd line of recycle.txt line = sr.ReadLine(); //Read the 1st line of objectRef.txt string line2 = sr2.ReadLine(); //Read the 2nd line of objectRef.txt line2 = sr2.ReadLine(); here line,line2 will have the second lines from both the textfiles what is the logic