I am novice in AngularJS. I was trying to send an object from one controller to another using $routeParams
.
$location.path("/addMyResults/"+JSON.stringify($scope.resultsObj));
This is how i am routing:
$routeProvider
.when('/addMyResults/:myresultsObj',{
templateUrl : 'partials/myResultsAdd.html',
controller : 'AddMyResultsController'
});
and collecting the object in another controller as:
$scope.resultsObj = angular.fromJson($routeParams.resultsObj);
The resultsObj has two string properties name & address.
When '/'
is entered into the address string(infact any field) the routing does not work.
Please let me know if there is some solution.