This is undoubtedly one of the trickiest issues to encounter when developing a project with AngularJS:
ionic.bundle.js:26799 Error: [$injector:unpr] Unknown provider: fifoServiceProvider <- fifoService <- FifoController
http://errors.angularjs.org/1.5.3/$injector/unpr?p0=fifoServiceProvider%20%3C-%20fifoService%20%3C-%20FifoController
at ionic.bundle.js:13443
at ionic.bundle.js:17793
at Object.getService [as get] (ionic.bundle.js:17946)
at ionic.bundle.js:17798
at getService (ionic.bundle.js:17946)
at injectionArgs (ionic.bundle.js:17970)
at Object.instantiate (ionic.bundle.js:18012)
at $controller (ionic.bundle.js:23417)
at Object.self.appendViewElement (ionic.bundle.js:59908)
at Object.render (ionic.bundle.js:57901)
Encounter this problem, have no hint at all, look for a problem all have no way to start, headache unceasingly.
before we talk about the solution, let’s look at the angular.module function:
angular.module('MyApp',[])
In a SPA project, we can actually add more than one module. The module’s dependencies are then declared in that bracket.
This type of dependent function is called a module declaration.
angular.module('MyServices',['OtherService'])
He also USES it in another way, without the parenthesis:
angular.module('MyServices')
This method without brackets is used to refer to the module. So, the same module, of course, we only need to declare once OK:
angular.module('MyApp',['MyControllers','MyServices','MyDirectives']);
angular.module('MyControllers',[]);
angular.module('MyServices',[]);
angular.momdule('MyDirectives'[]);
So, angular.module(“,[]) is used to declare a module, equivalent to the setter function of an Angular module. Angular.module (), which refers to a module, on which we can add our own definitions.
So I check the code. Almost every service has an Angular. Module (“,[] “) in it. This is used to declare modules. Specially here to write, record down, hope to have encountered the same problem can adopt, this pit is really deep…
Read More:
- Angular $ injector:unpr Unknown Provider Error Fixed
- Solve angular’s cannot find module ‘@ angular devkit / core’ problem
- Ngif of module in ionic 5 + angular
- When angular4.0 starts the project, an error is reported: the “@ angular / compiler cli” package was not properly installed
- Angular Error You seem to not be depending on “@angular/core“ and/or “rxjs“. (Fixed)
- ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)
- Error: failed to find conversion function from unknown to text
- Module not found error: the solution to the problem of no module named ‘MySQL’
- [solution] a perfect solution to the problem of failed to load module “Canberra GTK module” in Ubuntu
- No value has been specified for this provider
- Solution of Greenplum query calling function error
- Android license status unknown solution
- Local workspace file (‘angular.json’) could not be found.
- Webpack error module build failed: typeerror: fileSystem.statSync is not a function
- The C compiler identification is unknown solution
- MySQL appears: ERROR 1049 (42000): Unknown database’XXX’ solution
- MySQL unknown column ‘in’ field list ‘solution
- Webpack report error: unknown option ‘- p’ solution
- ValueError: Unknown label type: ‘unknown‘
- Call to undefined function mysql_ Connect() solution summary