Q:

How to change selected index item value with ng-repeat in Angularjs?

This is my example code. I'm trying long time but not able to figure out.
app.controller('homeTabCtrl', function($scope) {

    $scope.foodTypes = [{
        'filterId': 1,
        'countryName': 'American',
        'foodIcon': 'img/icon-burger.png'
    }, {
        'filterId': 2,
        'countryName': 'Korean',
        'foodIcon': 'img/icon-processing.png'
    }];

    /* Discover live order example */
    $scope.fId = 1;
    $scope.fId.push('filterId': 'India');

});

Here i have selected the first index. I want to change country name for first index. How can i implement this one with controller itself.

A:

fId should be array if you want to push items in it
To push object you need to use {} syntax.

SYNTAX ERRORS
Change:
$scope.fId = 1;

To
$scope.fId = []; // Notice [] Define blank array

Change
$scope.fId.push('filterId':'India');

TO
$scope.fId.push({
    'filterId': 'India'
}); // Notice { and }

Example
$scope.foodTypes[0].filterId = 'India';

A:

In order to change the existing object, you need to find it first.
$scope.foodTypes.find(function(food) {
    return food.filterId === 1;
}).countryName = "India";

If you know that it's always the first object, then:
$scope.foodTypes[0].countryName = "India";

Will work just fine.

