AngularJS $promise is undefined

旧巷老猫 提交于 2019-12-05 20:34:47

The $resource service doesn't return promises in version 1.0.x; be sure to read the correct version of the docs. By default, http://docs.angularjs.org/api/ is for the 1.2.x series, which is currently unstable. Try this version of the api docs: http://code.angularjs.org/1.0.8/docs/api

Since you are using $resource you can do

 getAllUsers.get({},function(data) {
    loadDatatable(data);
 });

Did you forget to add .json as type of call?

app.factory "User", ["$resource", ($resource) ->
  $resource("/users/:id.json", {id: "@id"}, {update: {method: "PUT"}})
]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!