Questions tagged [angular-providers]

The service providers are constructor functions. When instantiated they must contain a property called $get, which holds the service factory function.

angularjs doc

173 questions
1
vote
2 answers

Angular 1.5 Unknown provider

So i get the: Error: $injector:unpr Unknown Provider Unknown provider: canOrganiseProvider <- i cannot figure out why, i simple have this end point which i've tested it works ok, and just want to resolve this before i navigate to a route, it…
user6015054
1
vote
3 answers

Angular 'Unknown provider error' (of a factory file) when I use ngroute

I want to pick this html page:

Elenco dipendenti

Giacomo Brunetta
  • 1,409
  • 3
  • 18
  • 38
1
vote
2 answers

AngularJS Error: [$injector:unpr] Unknown provider: eProvider <- e <- $exceptionHandler <- $rootScope

I am suddenly seeing this error on our EC2 production instance. I deployed a new release and realized the error. Afterwards, I deployed the earlier version but the issue did not get resolved. The error shows up no matter whatever previously working…
nael
  • 1,441
  • 19
  • 36
1
vote
1 answer

Angular Providers

Following the angular 2 tutorial @ https://angular.io/docs/ts/latest/tutorial/toh-pt4.html In the @Component({ }) I inserted "providers: [HeroService]" which contains the getHeroes() method. Created a constructor: constructor(private heroService:…
Anthony Davis
  • 139
  • 2
  • 11
1
vote
1 answer

Angular 2 nested injection

I am struggling with angular2's dependency injection. In my example I have two Services. Service1 injects Service2 and gets data from it. A Component injects Service1 and fetches the data from Service1 I have to provide Service2 in my…
Dan
  • 787
  • 1
  • 7
  • 20
1
vote
1 answer

Unknown provider

I have come across a quite peculiar error on my AngularJS code of a web application. I have an application which has a form for inserting new data in the database, but before that it's going to look for any coincidences. Now, the object that we…
Steven
  • 1,236
  • 1
  • 13
  • 37
1
vote
0 answers

Decorated $log fails in unit tests because of ngMock

In out project we have decorated $log service, that exposes a method .prefix(). We use it like $log.prefix('Some Prefix text here'). This works fine in every module we use $log in, but not the unit tests: $log.prefix is not a function It has to do…
1
vote
1 answer

Should angular .value and .constant be used to store initialization values and utility functions?

I have a fairly complex angularJS application built with many modules, factories and controllers. When this was started I used a parameters.js file to store initialization vars and constants used in the application. Some of these values are…
David
  • 3,364
  • 10
  • 41
  • 84
1
vote
1 answer

Angular provider configuration reset when service injected into somewhere else

Not an easy one to describe this, but basically I have a service which is set up as a provider so I can configure it. It has an array of APIs used in my project which is initially empty. Various config blocks can add an API object to the array and…
jonhobbs
  • 26,684
  • 35
  • 115
  • 170
1
vote
1 answer

Angular factory returning only part of resource response

I have an Angular factory DogePrice: .factory('DogePrice', ['$resource', function ($resource) { return $resource("https://chain.so/api/v2/get_info/DOGE"); }]) The typical api response is like this: { "status" : "success", "data" : { …
1
vote
1 answer

angular2 No provider for NavigationService! (MenuComponent -> NavigationService)

I'm trying to create an angular (beta7) app. At the top there should be a MenuComponent that uses the NavigationService to navigate to different parts of my app. I want the NavigationService to be singleton and therefore am instantiating it with…
wertzui
  • 5,148
  • 3
  • 31
  • 51
1
vote
1 answer

Creating nested route app in angular using angular-ui-router and switching between modules

I want to create angular nested routes in my application using angular-ui-router with multi sub-modules; In "ui-router" we can use multi views in our main app config as $stateProvider, but can't switch between sub-modules when you are in other…
Maher
  • 2,517
  • 1
  • 19
  • 32
1
vote
1 answer

In Angular, why am I forced to declare the provider before the config?

Why am I forced to declare the provider before the config function that will uses it? In others words, this code works: angular.module('app') .provider('testService', function() { // ... }) .config(function(testServiceProvider) { //…
Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
1
vote
2 answers

How to read the data from json file and return as string or object in angularJS?

personManagerInstance.getString("firstname",'common','en') currently i pass direct string in ui its affecting but what i exactly need is read the data from json file and return as string.. personManagerInstance.getString("firstname",'common','en')…
1
vote
0 answers

Angular material $mdthemingprovider dynamic themes

I'm trying to put dynamic themes, but I can not spend scopes, variables for $mdthemingprovider. The way that I thought was a provider with my resource, but have no idea how to create one. I have 2 forms that I use today, which are $rootScope and…
Marco Riesco
  • 401
  • 1
  • 6
  • 17