I am currently working on a basic Router setup:
.when('/login/:id', {
templateUrl: 'views/login.html',
controller: 'RoomLoginCtrl',
resolve: {
roomData: function($route, ServerService) {
var id = $route.current.params.id;
return ServerService.getRoomData(id); //returns promise
}
}
})
....
Here is the code for the associated controller:
(function(angular) {
angular.module('app')
.controller('RoomLoginCtrl', RoomLoginCtrl);
function RoomLoginCtrl($location, DataService, roomData) {
var vm = this;
vm.$location = $location;
vm.DataService = DataService;
vm.roomData = roomData;
vm.userName = "";
}
})(angular);
I recently encountered an error that reads:
Error: [$injector:unpr] Unknown provider: roomNameProvider <- roomName <- RoomLoginCtrl
It's confusing because when I check while debugging, roomData
does have the resolved value. The application crashes later on without any specific operation triggering it (as far as I can tell).
Any insights on why this issue might be happening?
Thank you!