This is my code for the Services.js file:
angular.module('RateRequestApp.services', []).
factory('rateRequestAPIservice', function($http) {
var rateRequestApi = {};
rateRequestApi.getData = function () {
return $http({
method: 'Get',
url: '../services/getratesws.aspx?fn=parcellookupData'
});
}
return rateRequestApi;
});
Now, moving on to the Controller.js file:
angular.module('RateRequestApp.controllers', []).
controller('ReadOnlyController', function ($scope, rateRequestApIservice) {
$scope.rateData = [];
rateRequestApIservice.getDrivers().success(function (response) {
//Dig into the responde to get the relevant data
$scope.rateData = response;
});
});
In App.js, we have the following code:
angular.module('RateRequestApp', [
'RateRequestApp.controllers',
'RateRequestApp.services'
]);
Lastly, in the HTML, include the following scripts:
<script src="scripts/Angular/App.js"></script>
<script src="scripts/Angular/Services.js"></script>
<script src="scripts/Angular/Controllers.js"></script>
Although everything appears correct, an error message is displayed:
Error: [$injector:unpr] Unknown provider: rateRequestApIserviceProvider <- rateRequestApIservice
Can someone help identify what may be causing this error?