I am new in AngularJS. I'm creating an app about the dynamically users add, edit and delete process. But I'm facing problem when the user edit their data.
When User edit on edit button I want country list to be predefined and state list defined by the selected country, but it does not work. Here is my code:
<select class="form-control"
data-ng-model="countrySelectModel"
data-ng-change="countrySelectChange(countrySelectModel)"
data-ng-options="Country.CountryName for Country in CountryListUpdate track by Country.CountryCode">
<option value="">Select Country</option>
</select>
and controller
app.controller("VitermineNgAppCLUCtrl", function($scope, countryService) {
//===== Get Country Change code/value
$scope.countrySelectChange = function(countrySelectModel) {
$scope.$emit('eventName', {
message: countrySelectModel.CountryCode
});
};
GetAllCLUDetails();
//==To Get All Records
function GetAllCLUDetails() {
var Data = countryService.getCLU();
Data.then(function(d) {
$scope.CountryListUpdate = d.data;
}, function() {
alert('Error');
});
};
});