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
Mayank Bhushan
NA
40
3.3k
Regarding get index value
Jun 4 2018 8:28 AM
<div angucomplete-alt id="ex5" placeholder="Search By Food Items" pause="100"
selected-object="SelectedItems" ng-model="items.itemSelected" local-data="arrItems" search-fields="ItemsName"
title-field="ItemsName" minlength="1" input-class="form-control" match-class="highlight" ng-required="true" input-changed="inputChanged" auto-match="true" ng-value="{{$index}}" ng-click="getMonthId($index)">
<input id='x' type='hidden' name='token' ng-model='items.token' value='{{$index++}}' />
</div>
How to get index value in ---
$scope.SelectedItems = function (selected) {
ItemsId = selected.originalObject.ItemsId;
Name = selected.title;
//alert(items.itemSelected)
console.log('txtAutocomplete', index);
$http({
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: '{ "ItemsId":"' + ItemsId + '" ,"ItemsName":"' + Name + '" }',
}).then(function (response) {
var resTotal = JSON.parse(response.data);
console.log('resTotal', resTotal);
var i = 0
//for (i == 0; i <= resTotal.length; i++) {
$scope.tempValue = resTotal[0].TotalCalories;
//console.log('$scope.items.txtitemCal[Index]', $scope.items.txtitemCal[Index])
//$scope.price[]
$scope.items.txtitemCal = $scope.tempValue * $scope.items.txtitemsCount;
// arrtoatlAmount.push($scope.txtitemCal);
// }
// $scope.price[index] = resTotal[0].TotalCalories;
console.log('$scope.txtitemCal', $scope.tempValue);
}, function (response) { // optional
// failed
console.log('failed');
console.log(JSON.stringify(response));
});
}
Please reply me asap.
Reply
Answers (
2
)
Uncaught Error: Template parse errors: Can't bind to 'ngFor'
Angular 5 - intellisence in VS 2017