The problem with angular.js using $resource service to store data into mongodb.
过去多啦不再A梦
过去多啦不再A梦 2017-05-15 17:01:54
0
2
547

Please give me an answer. Please output scope.code scope.name separately. These are all valuable. . But why does the content of the console be {object object}], and the storage into the database fails...

Now this region has been jsonized, but it still cannot be saved successfully...

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
伊谢尔伦

1. Because you converted the region object into a string, '+*string' calls the toString method of $scope.region

console.log($scope.region)

2. It is not converted into JSON format

小葫芦

First of all, print it out [object Object]是没问题的,因为你的$scope.regionIs it really an object? If you want to print the real content, you should write like this:

console.log($scope.region);//后面不要链接其他字符串

Second, the save failed. Please type out the error message so that we can check it for you

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template