Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
How do I fix "Uncaught TypeError: can't access property "whenGET", $httpBackend is undefined"?

I am trying to use the following https://embed.plnkr.co/plunk/pWNOdA in a project that uses strict-DI.

In the app-mockbackend.js you can see the following setup -

angular.module('app').run(function($httpBackend, ServerDataModel) {
    
    $httpBackend.whenGET('/games').respond(function(method, url, data) {
        var games = ServerDataModel.findAll();
        return [200, games, {}];
    });
}]);

When you run the app without strict it runs fine, but when you add ng-strict-di to your app I get:

Uncaught TypeError: can't access property "whenGET", $httpBackend is undefined

I have read the docs and with other areas, I have had to annotate services while using strict and the errors have subsided and it's great - I just cannot seem to figure this one out.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Hey Dale did you try to annotate the function?

https://docs.angularjs.org/guide/di#dependency-annotation

For example:

someModule.controller('MyController', ['$scope', 'greeter', function($scope, greeter) { // ... }]);

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda