{"size": 816, "ext": "js", "max_stars_repo_path": "zensum/app/services/pageService.js", "max_stars_repo_name": "synchronit/synchronit_website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "zensum/app/services/pageService.js", "max_issues_repo_name": "synchronit/synchronit_website", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "zensum/app/services/pageService.js", "max_forks_repo_name": "synchronit/synchronit_website", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.1379310345, "max_line_length": 83, "alphanum_fraction": 0.4068627451}
var app = require('../config');

app.factory('pageService', ['$http', '$q', '$route', function ($http, $q, $route) {

    return {
        getPageData: function (callback) {
            
            var path = $route.current.originalPath;
            //var deferred = $q.defer();
            
            if(path === '/') {
                path = '/home';
            }

            $http.get("app/fakes" + path + ".json")
                    .success(function (data, status, headers, config) {
                        //deferred.resolve(data);
                        callback(data);
                    })
                    .error(function (data, status, headers, config) {
                        //deferred.reject(status);
                    });

            //return deferred.promise;
        }
    };

}]);
