Questions tagged [angularjs-provider]

A provider is an object with a $get() method. The injector calls the $get method to create a new instance of a service. The Provider can have additional methods which would allow for configuration of the provider.

59 questions
1
vote
1 answer

Adding templateUrl dynamically while setting $routeProvider $ angular.config

I am angular newbie.I would like to achieve following code... $routeProvider.when('/view', {templateUrl: 'ViewSwitcher?pageId='+$rootSope.pageId+'&userId='+$rootSope..userId+'&token='+$rootScope.token, controller: ''}); ViewSwitcher is a servelet…
1
vote
0 answers

Formatting a date in custom request transformer

I'm new to AngularJS and I'm hitting the ground speeding at about 100mph. I'm trying to call a RESTful service from an angularjs site. The RESTful service uses an NH-HMAC authentication scheme. Part of the HMAC256 hash the service expects is a…
Josh
  • 2,955
  • 1
  • 19
  • 28
1
vote
1 answer

Unknown Provider error Angular

Error: [$injector:unpr] Unknown provider: flowFactoryProviderProvider <- flowFactoryProvider <-…
1
vote
0 answers

issue extending angular-ui-bootstrap tooltip

I'm attempting to build an extended version of the Angular UI Bootstrap tooltip although it's really more of a translation of the $modal provider into a tooltip provider my intent is to create a tooltip that will have its own controller - in…
1
vote
3 answers

AngularJS: injecting providers in .config function

I'm failing to inject a AngularJS Provider, called UserAgent inside a .config function but I'm getting this error: Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:unpr] Unknown provider:…
1
vote
2 answers

Angular: Optionally configure a service

I have a service that has an internal list of directive names (lets call it listService). In the spirit of loosely coupled applications I want other modules to be able to add their own directives to that list instead of statically defining it in the…
tobib
  • 2,114
  • 4
  • 21
  • 35
0
votes
1 answer

how to create different versions of a service using angularjs providers

I have a function called itemService.. gets item from shoppingList controller and push it into items array then return this array back. now i need to create 2 shoppingLists so using .factory i manged to make both controllers get different version of…
0
votes
0 answers

AngularJS advice on converting Factory to Provider?

I need to inject content from a Factory into a Config but I know this isn't possible and is only possible if I use a provider instead, so please can anyone advise how to convert my factory into a Provider? var templateApp =…
0
votes
0 answers

Why does running this AngularJS code locally work, but not on IIS?

I have a settings provider that runs fine on localhost, but doesn't work on IIS. The error from AngularJS is: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:unpr] Unknown provider:…
0
votes
1 answer

AngularJS unknown provider after code refactoring

I have an app which worked great, until I decided to refactor the code and use Gulp for my project. Here is the error I get: Error: [$injector:unpr] Unknown provider: _Provider <- _ <- utilsFactory <- storageService <- httpRequestInterceptor <-…
Carrm
  • 1,485
  • 3
  • 24
  • 45
0
votes
2 answers

Run a function before running a controller

I have defined a factory auth as follows: app.factory('auth', [function () { var auth = {}; auth.getUser = function () { ... ... // get user from cookie, cache, history, etc. } return auth }]); For many pages, I…
0
votes
1 answer

typescript not recognizing the interface on angularjs providers $get method

OK, so I wanted to have a provider which would allow me to closure the reference for the state provider. So, I've got the JS code and I'm trying to migrate it to TS. This is what I've got so far, but for some reason it keeps on complaining that…
0
votes
0 answers

Angular + response headers - can´t access response headers from $http provider

I've tried to access response headers through $http provider without success. In my research I read that it's a CORS issue. But that doesn't make any sense because reading the headers in GoogleChrome inspector(Network section), the headers are…
0
votes
0 answers

AngularJS service cannot access its own functions when used through provider

Here's my provider: class testPr { .... /** @ngInject */ $get($rootScope, $timeout, $window, FacebookService) { const _this = this; this.sdkInit($rootScope, $timeout, $window); FacebookService.setPermissions(this.permissions); …
0
votes
0 answers

AngularJs inject providers error

I'm trying to inject two providers and I have an error: Error: [$injector:modulerr] Failed to instantiate module App due to: [$injector:unpr] Unknown provider: $paginationTemplateProvider Here's my code: var app = angular.module('App',…
mskuratowski
  • 4,014
  • 15
  • 58
  • 109