I have a service with a method:
service.getVenueBySlug = function(slug) {
return $http.get(API + '/venue/' + slug);
};
In my app.routes.js`:
.state('app.venue', {
url: '/venues/:venueSlug',
templateUrl: '/app/views/venue.html',
controller: 'VenueController',
resolve: {
venue: ['VenueService', '$stateParams', '$state', function (VenueService, $stateParams, $state) {
return VenueService.getVenueBySlug($stateParams.venueSlug).then(function(res) {
return res.data;
}).catch(function(err) {
$state.go('app.404');
});
}]
}
})
The controller VenueController simply has:
$scope.venue = venue
Everything is working and it's correctly redirecting to 404 if I manually go to an URL with a wrong venue slug.
The issue is that I'm receiving an error in the console that it's bothering me:
Does anyone know how to fix? I'm using angular 1.6.4 and angular-ui-router 1.0.6.
