Q:

AngularJS - Update json information

First of all sorry if this question was asked before but i couldn't find an answer to it. Also , i am very new to angular so if the question seems stupid then sorry. So, onward to business.
I am trying to build an AngularJS app that (for now) uses $http to get a json,
displays the info inside in the view and when you press a button for example , the info in the view changes. I`ve managed to get the $http request and display it , but i can't for the life of me figure out how to manipulate the json data that i got. I've tried storing the data inside another variable using things like JSON.parse() and angular.toJSON but none seem to work. How can i go about doing this?
Here is the code I have so far:

<body ng-controller="MessageController">

   <table>
     <thead><tr><th rowspan="4" scope="col">Studenti</th></tr></thead>
     <tbody>
     
      <tr>
        <td>Nume:</td>
        <td ng-repeat = "student in students">{{student.name}}</td>
      </tr>
      <tr>
        <td>Skill:</td>
        <td ng-repeat = "student in students">{{student.skill}}</td>
      </tr>
      <tr>
        <td>Oboseala:</td> 
        <td ng-repeat = "student in students">{{student.oboseala}}</td>
      </tr> 
      
     </tbody>     
  </table>
    
    <button ng-click="changePcStatus()">Turn on Computer</button>
    <p>Pc state: {{pcState}}</p>
    
    
  </body>

and the Controller :

var nameSpace = angular.module('myApp.controllers', []);

nameSpace.controller('MessageController', [ '$scope', '$http', function($scope, $http)
{                                     
  
  
    $http.get('js/data.json').success(function(data){
      $scope.students = data;
    }).error(function(data, status, headers, config) {                                
      alert("error");
                                                      
    });
      
  var pcStatus = false;
  var counter = 0;
  $scope.pcState = "Off"
  
    $scope.changePcStatus = function(){
    
      if(counter === 0){
    $scope.pcState = "On";
    pcStatus = true;
      counter++;
        
    } else {
    alert("The pc was already turned on once!");
    };
    
      
    }; 
  
  
      }]);

Basically , what I want to do is , when i press the "Turn on computer" button , the "skill" off each student should go up a few points and this should be reflected in the view.
Edit: This seems to have worked. Thank you very much. @Cerad said if i have more info in the data.json i would have to change the statement. how so? (i do have more). It seems that $scope.students can only be accesed inside the .success. if i try to work with it outside the .success function it just breaks the app (is $scope.students just a local variable? if so how would i go about making it accesable globally?).

A:

I agree with the previous answer. Why not just do 
$scope.changePcStatus = function(){
    $scope.students.forEach(function(student){
        if(student.hasOwnProperty('skill')){
            student.skill++;
        }else{
            student.skill =0;
        }
    });

 // your code

}; 

