//service代码var services = angular.module('guthub.services', ['ngResource']);services.factory('Recipes', ['$resource', function($resource){ return $resource('/recipes/:id',{id:'@id'} );}]);//controller代码app.controller('ListCtrl',['$scope','Recipes', function($scope,Recipes){ $scope.recipes =Recipes;}]);//报错信息:Error:
[$injector:modulerr] Failed to instantiate module guthub due to: //[$injector:modulerr] Failed to instantiate module guthub.services due
to:
[$injector:nomod] //Module 'guthub.services' is not available! You either
misspelled the module name or forgot to //load it. If registering a module
ensure that you specify the dependencies as the second //argument.
1 回答
- 1 回答
- 0 关注
- 2641 浏览
添加回答
举报
0/150
提交
取消