Open hughred22 opened 9 years ago
To open an object in the console you can do console.log(JSON.stringify($stateParams.otherUser))
. This is the place where one state sends data to another state. If you pass in an object in the first one, you should receive an object here. Can you check that?
So on your ChatDetailCtrl, you have $scope.chatToUser = $stateParams.otherUser; $scope.chatToUser = JSON.parse($scope.chatToUser);
It return error: SyntaxError: JSON Parse error: Unexpected identifier "object"
I try to do console.log ($stateParams.otherUser) and it return [object object] which I can not open it in console. No idea what kind of object it is. And I never see to pass object like this in stateParam. The usage is new to me and I can not find any doc to explain passing object like this. Please explain.