Hi,
You need to include the ui state params service in your controller.
This will then have the data that you need and you can just read it like a
normal Javascript object.
Here's the examples :-
https://github.com/angular-ui/ui-router/wiki/URL-Routing
I code in Typescript using interfaces so I am not 100% sure what it's
called (ie it's $ name), but that link I sent contains all the information
you need.
If you need any more help, or it's not clear enough, just ask :)
Regards
Anthoni
On Thursday, 3 March 2016 00:46:41 UTC, Dave Abbott wrote:
>
> 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.