//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;}]);//報(bào)錯(cuò)信息: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 回答
- 0 關(guān)注
- 2672 瀏覽
添加回答
舉報(bào)
0/150
提交
取消