How to push data to factory/service in AngularJS/Ionic : (Case study ionic-framework-tutorial from Thinkster.io)

I am trying to implement this tutorial from Thinkers.io : https://thinkster.io/ionic-framework-tutorial/

I am already in Step 3 : "Building Interface Functionality" and got a little problem on "Adding, Removing and Retrieving Favorited Songs".

I've followed the step from : "create a User factory in services.js" until "add the current song to our favorites at the beginning line of sendFeedback() method".

When i try to click favorite button, and go to favorite page, there are nothing happen. The current song is note added to favorite list.

here's my code in controller.js

.controller('DiscoverCtrl', function($scope, $timeout, User) {
  $scope.songs = [
       {
          "title":"Stealing Cinderella",
          "artist":"Chuck Wicks",
          "image_small":"https://i.scdn.co/image/d1f58701179fe768cff26a77a46c56f291343d68",
          "image_large":"https://i.scdn.co/image/9ce5ea93acd3048312978d1eb5f6d297ff93375d"
       },
       {
          "title":"Venom - Original Mix",
          "artist":"Ziggy",
          "image_small":"https://i.scdn.co/image/1a4ba26961c4606c316e10d5d3d20b736e3e7d27",
          "image_large":"https://i.scdn.co/image/91a396948e8fc2cf170c781c93dd08b866812f3a"
       },
       {
          "title":"Do It",
          "artist":"Rootkit",
          "image_small":"https://i.scdn.co/image/398df9a33a6019c0e95e3be05fbaf19be0e91138",
          "image_large":"https://i.scdn.co/image/4e47ee3f6214fabbbed2092a21e62ee2a830058a"
       }
  ];

  // initialize the current song
  $scope.currentSong = angular.copy($scope.songs[0]);

  $scope.sendFeedback = function (bool) {
      // first, add to favorites if they favorited
      if (bool) User.addSongToFavorites($scope.currentSong);

      // set variable for the correct animation sequence
      $scope.currentSong.rated = bool;
      $scope.currentSong.hide = true;

      $timeout(function() {
        // $timeout to allow animation to complete before changing to next song
        // set the current song to one of our three songs
        var randomSong = Math.round(Math.random() * ($scope.songs.length - 1));
        // update current song in scope
        $scope.currentSong = angular.copy($scope.songs[randomSong]);
      }, 250);
  }
})


.controller('FavoritesCtrl', function($scope, User) {
// get the list of our favorites from the user service
$scope.favorites = User.favorites;
})

This following code in service.js

angular.module('songhop.services', [])
.factory('User', function() {
  var o = {
    favorites: []
  }
  return o;

//Method for adding songs to the favorites array:
o.addSongToFavorites = function(song) {
// make sure there's a song to add
if (!song) {
    return false; }
// add to favorites array
o.favorites.unshift(song);
}

});

Anyone have a clue? It Would be greatly appreciated.

There is a small issue with your code, the return statement comes before the service declaration is complete. Move return to the last.