title: How to push data to array in factory/service (ANGULAR/IONIC)
body: <p>I want to create an app that work like this : <a href="https://ionic-songhop.herokuapp.com" rel="nofollow">https://ionic-songhop.herokuapp.com</a></p>
  
  <p>As you can see, when we click favorite button, the item will store in factory and we can invoke in another page (favorite page)</p>
  
  <p>In my case : i use service to store the item data and create factory to store the pushed item.</p>
  
  <p>Here's my code : (I store data in service)</p>
  
  <pre><code>.service('dataService',function(){
    var service=this;
      this.playerlist = [
      { name: 'Leonel Messi', ava:"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68" },
      { name: 'Cristiano Ronaldo', ava:"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68" },
      { name: 'Zlatan Ibrahimovic', ava:"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68" },
      { name: 'Wayne Rooney', ava:"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68" },
      { name: 'Michael Carrick', ava:"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68" },
      { name: 'Phil Jones', ava:"https://pbs.twimg.com/profile_images/473469725981155329/E24vfxa3_400x400.jpeg" },
      { name: 'Angel di Maria', ava:"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68" }
      ]; 
  })
  
  .factory('User', function() {
      var play = { favorites: []}
  
      play.addToFavorites = function(song) {
        play.favorites.unshift(song);
      }
  
      play.removeFromFavorites = function(player, index) {
        play.favorites.splice(index, 1);
      }
      return play;
  })
  </code></pre>
  
  <p>Controller :</p>
  
  <pre><code>.controller('ChooseTabCtrl', function($scope, dataService, User) {
    $scope.dataService=dataService;
    $scope.addToFavorite = function (item) {
        User.favorites.unshift(dataService.playerList.indexOf(), 1);
    }
  })
  </code></pre>
  
  <p>But when i click the favorite button on each item, the list dont show in favorite page.
  Is it possible to do like this in Ionic app?</p>
  
  <p>Here's my codepen : <a href="http://codepen.io/harked/pen/WvJQWp" rel="nofollow">http://codepen.io/harked/pen/WvJQWp</a></p>