Module is not available, misspelled or forgot to load (but I didn't)

后端 未结 9 2188
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 12:17

I am fairly new to angular and using it with JSON api files. TO test, I am trying to use the free github api (my names for functions are for a different json api that i will

9条回答
  •  时光取名叫无心
    2020-12-13 12:59

    I got this error when my service declaration was inside a non-invoked function (IIFE). The last line below did NOT have the extra () to run and define the service.

    (function() {
        "use strict";
    
        angular.module("reviewService", [])
            .service("reviewService", reviewService);
    
        function reviewService($http, $q, $log) {
            //
        }
    }());
    

提交回复
热议问题