Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More issue! SyntaxError: JSON Parse error: Unexpected identifier "object" #3

Open
hughred22 opened this issue Aug 18, 2015 · 1 comment

Comments

@hughred22
Copy link

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.

@arvindr21
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants