It seems that it is still a problem with angular.js, but I don't know if it is a problem with $resource or somewhere else. Ask God for answers
滿天的星座
滿天的星座 2017-05-15 17:01:48
0
1
537

The data I entered is all in http://localhost:3000/api/region, but when I want to get one of the objects, my url becomes http://localhost:30 00/api/regions
Then I can only access individual objects like this
http://localhost:3000/api/regions/573a8752d5894fbc0ce91cbb. .

Please ask God for an answer, really. I can’t thank you enough

滿天的星座
滿天的星座

reply all(1)
给我你的怀抱

What you said is correct, I got the object after following restful定义,获取一个资源应该按照/api/regions/:regionID这种形式没有错,这也是为什么你说使用/api/regions/573a8752d5894fbc0ce91cbb.

Storage passes/api/region no problem either. is right.

As for what you said passed/api/regions?_id=573a8752d5894fbc0ce91cbb仍然是拿到了一堆数据的数组,而不是对象,很简单,就是因为我上面说的第一点,restful里规定获取某一个资源一定要用/api/regions/:regionID的形式,不是/api/regions?_id=:regionID

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