Sorry, I'm new to webDev. How I can get data from factory to mainCtrl.
Code:
shopApp.controller("mainCtrl",function($scope,newItemsFactory){
    $scope.newItems=newItemsFactory.getNewItems();
    console.log($scope.newItems);  //NOT WORK
});
shopApp.factory('newItemsFactory',function($http){
    return{
        getNewItems:function(){
            $http({method: 'GET', url: '../php/newItems.php'}).
                then (function success(response) {
                       return response.data;
                    }, function error(response) {
                        console.log("Error!");
                    }
                );
        }
    }
});
Thank you)
