(function () {
    'use strict';

    angular.module('Monitour.pages.register')
        .factory('RegisterService', RegisterService);

    function RegisterService($http, $localStorage) {
        var service = {};

        service.Create = Create;




        var domain  = 'https://api.callio.com.au/public/';
        return service;



        function Create(register) {
            return $http.post(domain + 'register', register).then(handleSuccess, handleError('Error registering '));
        }




        // private functions


        function handleSuccess(res) {
            return res.data;
        }

        function handleError(error) {
            return function () {
                return { success: false, message: error };
            };
        }



    }

})();