未捕获的错误:没有模块:用户Angularjs [英] Uncaught Error: No module: users Angularjs

查看:156
本文介绍了未捕获的错误:没有模块:用户Angularjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是一个跟进的问题<一href=\"http://stackoverflow.com/questions/18312689/how-to-fetch-index-data-in-angular-using-rails-server\">How使用Rails服务器角度来获取索引数据

this is a follow up question of this How to fetch index data in Angular using rails server


如何正确上传/链接角模块与HTML?

Question How to correctly upload / link angular module with html ?

继接受的答案并更新code,我不能加载模块的用户:

Following the accepted answer and updating the code, I can not load module users:

Uncaught Error: No module: users 

从我的项目的要点是这里

更新code:

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是这里

推荐答案

您有语法错误以下

return $resource "users/:id", { id: '@id' }, {
    ...
}

return $resource("users/:id", { id: '@id' }, {
    ...
});

这篇关于未捕获的错误:没有模块:用户Angularjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆