Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Below javascript code is executed in browser. How can I set photopath property of person object to get the right result "/image/john.jpg" when I run the command console.log($scope.person.photopath); instead of ""/image/john.jpg"". Thanks!

$scope.photo = data; // data is jsonp data type responded from nodejs sever
console.log(data); //print out: "/image/john.jpg"
console.log($scope.photo);   //print out: "/image/john.jpg"
$scope.person = {"name":"john",
                 "email": "[email protected]",
                  "photopath": $scope.photo};

console.log($scope.person.photopath);  //print out: ""/image/john.jpg""
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.