【发布时间】:2013-08-19 12:52:08
【问题描述】:
这是How to fetch index data in Angular using rails server的后续问题
问题 如何使用 html 正确上传/链接 Angular 模块?
按照接受的答案并更新代码,我无法加载模块用户:
Uncaught Error: No module: users
我的项目要点是here
更新代码:
app.factory('User', function($resource) {
return $resource "users/:id", { id: '@id' }, {
index: { method: 'GET', isArray: true, responseType: 'json' },
show: { method: 'GET', responseType: 'json' },
update: { method: 'PUT', responseType: 'json' }
}
})
var UsersIndexCtrl = function($scope, User) {
$scope.users = User.index();
};
根据接受的答案更新的 plunker 是 here
【问题讨论】: