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> 


-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to