I'm having issues accessing properties of a very simple object. As a novice programmer I suspect I have a simple misunderstanding of what exactly I'm working with.
Here is the code that is executing:
console.log(content);
console.log(content.title);
for (x in content){
console.log(content[x])
}
And here is the console response:
{"title":"test","description":"test"}
undefined
{
"
t
i
t
l
e
"
:
"
t
e
s
t
"
,
"
d
e
s
c
r
i
p
t
i
o
n
"
:
"
t
e
s
t
"
}
Any guidance would be greatly appreciated.
edit
The content object is being sent to the server via angular.js $http service as follows:
$http({
method:'post',
url:"/create/createContent",
params:{content:$scope.content}
}).
It seems the service moves the data in the JSON format.
Thanks everyone for the help! I really appreciate it.
content? Looks like it might be a string not an object. Alsofor...inis often more trouble that it's worth.