TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
suman goud
NA
176
53.7k
How to get dropdown selected id on ng-repeat in angular
Sep 19 2016 2:20 AM
by using this code am able to get dropdown id(if i comment ng-repeat)
<tr @*ng-repeat="r in rvm"*@ @*>
<td>
<select ng-model="ID" ng-options="c.ID as c.Name for c in customer" ng-change="GetAccountBalance($index)" style="width:150px;height:22px;" name=" tCustomer">
<option value="">Select Customer</option>
</select>
js
$scope.GetAccountBalance = function (index) {
var getAccountBalance = ReceiptsService.GetAccountBalance($scope.ID);
var id = $scope.ID;
alert(id);
but my requirement is adding new row on dropdown change
<tr ng-repeat="r in rvm">
<td>
<select ng-model="ID" ng-options="c.ID as c.Name for c in customer" ng-change="GetAccountBalance($index)" style="width:150px;height:22px;" name=" tCustomer">
<option value="">Select Customer</option>
</select>
js
$scope.rvm = [{}];
$scope.GetAccountBalance = function (index) {
if ($scope.rvm.length == (index + 1)) {
$scope.rvm.push({
});
}
var getAccountBalance = ReceiptsService.GetAccountBalance($scope.ID);
var id = $scope.ID;
alert(id);
am able to add new row by using this code , but am not getting selected id
how to selected dropdown id,
if i remove ng repeat am getting id ,
Reply
Answers (
3
)
how to convert and bind Json data to Gridview.
How to do Face detection in an image