Adding/Updating Items in Local Json File || Separating The Controller and Services Files

im new to angular and im trying to build a simple todo list application.Im using Ionic framework and test it using yeoman server. i've alredy managed to load a local json file but i searched and i can't find how to add items/update it.I will appreciate if you can give me direction on how to do this.

The second thing i want to do is to separate my controllers and services. currectly all the services are in the controllers.js file. both tasks should be pretty easy for the one that are experience with angular so i thought i'll just leave it for you guys :P

app.js:angular.module('Todo', ['ionic', 'Todo.controllers'])

Playlist.js(first page you get when lunching the app):

 <ion-content class="has-header">
    <ion-list>
      <ion-item ng-repeat="playlist in playlists" href="#/app/playlists/{{playlist.id}}">
        {{playlist.title}}
      </ion-item>
    </ion-list>
  </ion-content>

controller:

.controller('PlaylistsCtrl', function($scope, $http) {

  $http.get('jsonfile.json').success(function(data){
        console.log(data);
        $scope.playlists = data;
  }); 
})

I'll answer both your question in one ;

     .controller('PlaylistsCtrl', function($scope , GetPlaylists) {
         $scope.playlist =[];
         $scope.playlist =  GetPlaylists.getPlaylists(scope);
         // below is a function that you can use for example with buttons ng-click="addNewPlayer('Michel Jackson')"
         $scope.addNewPlayer = function(newPlayer){
            $scope.playlist.push(newPlayer)
        }
      })


      // To seperate your servises(which is a factory here) , cut and paste this factory in a new js file and include that js file in your index.html
     .factory('GetPlaylists',function($http){
       return{
          getPlaylists:function(scope){
             var promise = $http.get('jsonfile.json');
                 promise.then(function(data){
                    console.log(data);
                   return data 
                // I dont know about your json file , maybe you should write data.data or data[0] here
                //Just console.log(data) it , to find the correct answer
          }); 
      }}
     });