1. Angular uses provide to create services (that is, things that can be injected, to put it bluntly, they are provided for other modules to use). A service can define a provider. Whenever you define a provider for a service, the name of the provider is is serviceProvider. Here service is the name of the service. The services corresponding to $httpProvider and $stateProvider in the above picture are $http, $state... These angular built-in services are defined by a serviceProvider at the bottom.
2. After defining the service, we need to use it in the module. To use the service, we first need to reference the dependency on the service, for example: app.controller('xxController', ['xxservice', function(xxservice) {xxx}]) Here xxController references xxservice and then uses it in the module. The bottom layer of angular uses inject to reference the services that modules depend on.
Some angular built-in services ($scope) in Figure 2 can be used without introducing them, and there is another service that needs to be referenced before use ($http, $state...) You can refer to this article http:/ /sentsin.com/web/663.html
The parameters you mentioned are all services to be injected. Inject those services you need. If these services are not used in your .run, .config, .controller, etc., you don’t need to write them.
1. Angular uses provide to create services (that is, things that can be injected, to put it bluntly, they are provided for other modules to use). A service can define a provider. Whenever you define a provider for a service, the name of the provider is is serviceProvider. Here service is the name of the service. The services corresponding to $httpProvider and $stateProvider in the above picture are $http, $state... These angular built-in services are defined by a serviceProvider at the bottom.
2. After defining the service, we need to use it in the module. To use the service, we first need to reference the dependency on the service, for example: app.controller('xxController', ['xxservice', function(xxservice) {xxx}]) Here xxController references xxservice and then uses it in the module. The bottom layer of angular uses inject to reference the services that modules depend on.
Some angular built-in services ($scope) in Figure 2 can be used without introducing them, and there is another service that needs to be referenced before use ($http, $state...)
You can refer to this article http:/ /sentsin.com/web/663.html
The parameters you mentioned are all services to be injected. Inject those services you need. If these services are not used in your .run, .config, .controller, etc., you don’t need to write them.