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
0
votes
1 answer

AngularJs: myStorage is undefined error when inserting an object

I'm new to angular and I am trying implementing a local storage for my angular application. I have the basic CRUD operations. When I call the insert() function from my controller I get the error in the title, 'myStorage is undefined' MyApp.js var…
0
votes
1 answer

Angular 2 Component not updating using *ngFor with Reactive Provider

I am trying to create an Angular 2 Provider that does all the CRUD operations while using a reactive approach. However, my Ionic App adds to my list when I call loadAll() the first time, but anytime I call this.children.next(children) after that, it…
Daniel Hair
  • 270
  • 1
  • 4
  • 15
0
votes
1 answer

Extending input by using my own service

I want to extend input of type text in angular in such a way that after user enters some text, the text value is passed through a custom filter that do some purification on entering input, here is what I have come until now, but I am getting an…
0
votes
1 answer

Angular $routeProvider.html5Mode route crashes after manual refresh

After enabling $locationProvider.html5Mode(true); and in the index.html routes began crashes after manual reload. Looking up for solutions I found that .htaccess rules will fix this problem, but different configurations didn't…
lomboboo
  • 1,221
  • 1
  • 12
  • 27
0
votes
0 answers

Angular Google Map, lazy loading, second time

I'm using angular-ui.github.io/angular-google-maps/ I use the recommended lazy loading technique, I have this in my app.js: .config(function(uiGmapGoogleMapApiProvider) { uiGmapGoogleMapApiProvider.configure({ // key: 'your api key', v:…
Cokorda Raka
  • 4,375
  • 6
  • 36
  • 54
0
votes
1 answer

Angular Provider - $http is not defined when $get return object

if $get configured like so : Config : .config( function( authProvider ){ authProvider.initial(); }) Provider : .provider('auth', function() { this.initial = function() { obj.user = JSON.parse( localStorage.getItem('user') ); } var…
Moti Winkler
  • 308
  • 1
  • 4
  • 19
0
votes
1 answer

Provider 'FileUpload' must return a value from $get factory method

In a web application made with AngularJs there is a page where the user can upload a file. But I have some problem. This is the Factory that makes the upload: angular.module('app').factory('FileUpload', ['$http', function($http) { …
0
votes
1 answer

Angularjs provider: Resolve $http request before returning

I have a provider that looks something like the following: angular.module('myProvider', function(){ var appUrl = '' this.setAppUrl = function(url){ appUrl = url; } this.$get = ['$http', function($http){ return { appAction:…
biagidp
  • 2,175
  • 3
  • 18
  • 29
0
votes
0 answers

Angularjs Provider: is not a function

I am trying to configure my Module with a Provider that should allow a custom configuration. This is my Provider: var module = angular.module('myModule', []); module.provider('MyModule', function () { this.setBaseUrl = function (f) { …
Ricky
  • 285
  • 5
  • 17
0
votes
1 answer

How to wait for angular provider inside .config to fully load

I'm setting a value to the url variable inside the .provider in services.js from .config in app.js Services.js: function BaseUrl(url) { this.url = url; } angular.module('eter.services', []) .provider("baseurl", [function () { var…
TheWorldyn
  • 51
  • 1
  • 4
0
votes
1 answer

how to get callback response while use $http.post method inside of GPS detector function using factory in angularjs

I try to throw error modal window when the gps not enable. perhaps it's enabled then it will call servcie callback using $http.post method. But without gps function it's working and return promises fine. if use GPS method above the post…
0
votes
1 answer

How to use dependency injection in service based Angular2 project

The problem For the past week I've been working on a authentication library for an Angular2 project. This library is mostly service based and should work almost directly out of the box. The only thing you need to do is include it in your app and set…
0
votes
1 answer

Use this instead $scope on controller with provider

I´m learning about Providers. On a common controller I would use modu.controller("thecontrol", [function() { this.something = "Hello"; ]}); and on the HTML
{{ ctrl.something }}
But... I´m trying to…
Peter
  • 2,004
  • 2
  • 24
  • 57
0
votes
0 answers

Angular provider accepts function which needs dependencies

Wasn't sure what title to give this one but basically I have an authorization provider which I have created myself which need to be configured during the config phase to have a requireLogin() function which will be run at a later date. Like…
jonhobbs
  • 26,684
  • 35
  • 115
  • 170
0
votes
1 answer

Function inside provider not recognized by Angular

First a little background on what I want to achieve. I have a service that requires some configuration before it gets injected and used. After doing some research I figured that having a provider for the service would be the best solution. So I…
1 2 3
11
12