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""