這裏我有我的RestaurantList服務如下
var restaurantList = angular.module("service.restaurantList", []);
restaurantList.service('RestaurantListService', ['$rootScope', 'BackendService', 'toaster', '$cookieStore', 'getConstants', 'principal', '$state',
function ($rootScope, BackendService, toaster, $cookieStore, getConstants, principal, $state) {
/*
*/
}])
我有我的reservation.js代碼如下
var app = angular.module('reservation', ['angularMoment']);
app.controller('ReservationController',['$scope', 'ngDialog', 'BackendService','ReservationService','RestaurantListService', '$rootScope', 'toaster', "$timeout", "checkEmpty",
"$interval", "principal",
function ($scope, ngDialog, BackendService, ReservationService,RestaurantListService, $rootScope, toaster, $timeout, checkEmpty, $interval, principal) {
/*
*/
}])
在保留控制器我注射ReservationList服務。現在,它給出了錯誤
angular.js:12798 Error: [$injector:unpr] Unknown provider: RestaurantListServiceProvider <- RestaurantListService <- ReservationController
您是否提到過該服務? – Sajeetharan
我已提及它,但仍是相同的錯誤 – chyangba