I have a submit function in a controller and I need to keep the data entered in the form to make available it to show in another page of my web (I am using ui-router).
Can anyone please give me a hint about how can do that? How to pass the data from the controller to -don't know what and don't know how- so I can use the data in another page of my web?
Could it be that I have to pass the data from the controller to the routes file as parameters? If so, how can I do it?
Please, notice that I am quite new to Angularjs when explaining.
Thanks!
Here the controller, in case it helps:
(function () {
"use strict";
angular.module('public')
.controller('RegistrationController', RegistrationController);
RegistrationController.$inject = ['checkDishService','$scope','$stateParams','$http'];
function RegistrationController(checkDishService, $scope, $stateParams,$http) {
var reg = this;
reg.submit = function () {
/*//The form data:
$scope.reg.user.firstname,
$scope.reg.user.lastname,
$scope.reg.user.email,
$scope.reg.user.phone,
$scope.reg.user.dish*/
};//end of submit
}
})();