2013-08-19 34 views
0

這是該How to fetch index data in Angular using rails server未捕獲的錯誤:沒有模塊:用戶Angularjs

問題 的跟進問題,如何正確上傳/鏈接角模塊與HTML?

繼接受的答案和更新代碼,我無法加載模塊用戶:從我的項目

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

回答

0

你有語法錯誤有以下

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

應該

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