I have tried every google search on how to pass form data from one view to
another.
I simple have a registration form, when submitted I use $state.go(); to
show a thank you for signing up view / partial.
All I want is to pass the first_name and last_name from the form to the
thank you view.
Can anyone help?
$http.post(urls.BASE_API + '/notify', formData)
.then(function successCallback(response) {
$scope.formData = formData;
var data = formData;
$state.go('completed', {obj: formData});
//console.log(obj);
}, function errorCallback(response) {
alert('error');
console.log(response);
});
};
All the data i need is in formData,
MainController has:
$stateProvider
.state('index', {
url: "/",
templateUrl: "partials/index.html",
controller: 'HomeController',
params: {
'obj': null
}
})
.state('completed', {
url: "/",
templateUrl: "partials/completed.html",
controller: 'HomeController',
/*params: {
'obj': null
} */
});
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.