Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
35 views

I have a factory in my app which takes environment uri data as input parameter and returns a $resource object as below. The coreService is a singleton object used in many other controllers of UI. ...
Sby's user avatar
  • 11
-1 votes
1 answer
50 views

How can I implement caching in the angularJs factory without using cacheService?
Ajinkya Bodade's user avatar
1 vote
0 answers
74 views

I am relatively new to AngularJS and I was working on making the following within the Service with factory. I have the following call within the Service: factory.getUsers = function () { var ...
DAB's user avatar
  • 11
0 votes
1 answer
977 views

I am in the process of preparing to migrate an AngularJS app to Angular. I am currently looking at converting the JS code to TS. I haven't had any issues with components and services but factories. I ...
ymrs's user avatar
  • 171
0 votes
1 answer
111 views

I have configurations.js file which having var configurationModule = angular.module('configuration', ['restangular', 'notification']); configurationModule.factory('clientConfigSvc', function (...
Santosh Kori's user avatar
0 votes
1 answer
83 views

Neither $rootScope.$broadcast nor $rootScope.$emit is working from my factory I have $rootScope injected into the factory. The factory returns this function: alertHook: function() { $rootScope.$...
MMelvin0581's user avatar
0 votes
0 answers
83 views

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 ...
DominicA's user avatar
6 votes
1 answer
554 views

I have a controller as shown below. (function () { "use strict"; var app = angular.module('Demo') .controller('MainController', ['$rootScope', '$scope', '$location', 'curUser',MainController]); ...
TheLoneWolf91193's user avatar
0 votes
1 answer
93 views

I am trying to create a factory to retrieve weather data for a simple web page I am creating but, I am getting stuck when trying to call the function in the factory. I have fallowed Dan Wahlin's ...
Clint Clark's user avatar
1 vote
2 answers
485 views

I'm getting the following syntax error in the console while trying to get data from 'openweathermap' Uncaught SyntaxError: Unexpected token : Here is the JS file : var app = angular.module('App', [...
RoyBarOn's user avatar
  • 1,009
0 votes
1 answer
278 views

app.config(['$controllerProvider','$compileProvider', '$filterProvider', '$provide',function($controllerProvider, $compileProvider, $filterProvider, $provide) { app.register = { ...
phpnerd's user avatar
  • 926
0 votes
2 answers
40 views

In my html I have: <body ng-app='myApp'> <h1 ng-controller='controller'> {{YesOrNo}} </h1> <div ng-controller='controller'> <span>{{YesOrNo}}&...
Legend123's user avatar
  • 398
0 votes
2 answers
66 views

AngularJs - how to use factory with form input as part of URL to fetch? First question here. I am studying angular and was trying to use separated files for my services and also using a user input on ...
Pedro Santos's user avatar
0 votes
2 answers
62 views

I have a newbie question here. I am coding a factory in angularJS. With it I want to have a list of users, and also a method to fill it. So this is my code ... The factory app.factory("...
user avatar
0 votes
0 answers
109 views

I am working on AngularJS 1.6.9 JSONP . My api endpoint gives projectInstance.jsonpCallback function as a response. Inside factory method i had created same callback function and i got the response. ...
user3760261's user avatar
0 votes
0 answers
157 views

Is it possible to pass a parameter from ng-pattern(html input) to AngularJs factory? At the moment, I have a custom factory validateFormFieldFactory. And the custom factory/service is going to be ...
kerpekri's user avatar
  • 377
0 votes
1 answer
48 views

This is the factory I use right now, I get 2 json objects and try to do a array of them then I cant use it in the textreplacer. app.factory('myFactory', function ($http) { var service = {} var ...
Daniel Dehlin's user avatar
0 votes
1 answer
103 views

OK so I am trying to make a simple chat widget directive and I want it to be dynamically created wherever I want it on my app ie I do not want a hard coded solution. So I want the directive to be ...
RudolphRedNose's user avatar
-1 votes
2 answers
98 views

I've read a dozen blog posts and StackOverflow answers but my factory won't return its results to the controller. In the controller, I first make an object to send data to the factory, then call the ...
Thomas David Kehoe's user avatar
1 vote
1 answer
1k views

So what I'm doing is adding a directive as an attribute to an element via a Factory. And I have a separate directive file that manipulates the DOM based on some event triggered on that element, the ...
gj2110's user avatar
  • 11
0 votes
1 answer
263 views

I have a variable 'file' that is being passed to a directive which i am using in the same controller. Now i want to use that same 'file' in the factory that i am creating but i'm not sure if there is ...
zomdar's user avatar
  • 273
-1 votes
1 answer
178 views

I'm developing an e-commerce web app using AngularJS (v1.6.7) and Parse Server (v2.3.3). I created Category and Product class in Parse Server. I'm trying to fetch in a certain amount of products per ...
N'Bayramberdiyev's user avatar
0 votes
1 answer
1k views

In my AngularJS application, I have a controller-A and a factory. I am using the following code in factory to call the function in controller-A. In the initial call, the function in controller A's ...
Vishwa Dany's user avatar
0 votes
2 answers
410 views

I have defined a factory auth as follows: app.factory('auth', [function () { var auth = {}; auth.getUser = function () { ... ... // get user from cookie, cache, history, etc. ...
SoftTimur's user avatar
  • 5,770
0 votes
1 answer
148 views

I'm trying to pass data between (I think) two child controllers. Trying to do this with a factory. testFactory.js app= angular.module('testApp'); app.factory('values', [...
Max Power's user avatar
0 votes
4 answers
122 views

I am a bit new to angularjs. I have a service that works fine. however I would like to move the model (the patient model) out of the service and put it in a separtate javascript file. not quite sure ...
Bryan Dellinger's user avatar
0 votes
1 answer
77 views

I have an existing Angular Factory and I'm having some trouble inserting some new code that needs to pass the results of a $resource get to my Angular Controller. I'm trying to do this in the "...
Pete's user avatar
  • 123
0 votes
0 answers
753 views

I have created the angular Factory to get the results from the PHP and calling only one time but when I see in the Network its calling multiple times as shown below and its taking lot of time to get ...
Mahesh G's user avatar
  • 1,286
0 votes
1 answer
2k views

Can Anyone help me how to create multiple function in Angular JS Factory, And I want to access the returned value from one function and process something in another function , I have tried below but ...
Mahesh G's user avatar
  • 1,286
0 votes
2 answers
182 views

I am unable to fetch my json data using angular factory service. I seem to load the files correctly, no error on developer tools console, still the data is undefined on the request - means empty. ...
Barr J's user avatar
  • 11k
0 votes
3 answers
61 views

I have scope function ClickA and ClickB in my controller CtrlA, I want to re-use ClickA and ClickB with there containing scope variables "a" and "b" in almost every other controllers, I mean, I simply ...
Scavenger's user avatar
0 votes
0 answers
37 views

It's just a short question about AngularJS dependency injection. I have two factories, factoryA and factoryB, factoryB not using factoryA but factoryB not working if factoryA is not injected to it. ...
Tuximo's user avatar
  • 57
-1 votes
1 answer
37 views

So i have a file called app.properties which contains to urls in the format of somethingurl=http://.../.../.../something.js Note:there is actual url But i switched to an internet less environment ...
Timothy Lks's user avatar
0 votes
2 answers
60 views

Anyone can help with this? Can't update var ABCKey. Execute setAuthenticatedAccount and console.log return correct value. After that, run getAuthenticatedAccount, and receive undefined. angular....
Mateus's user avatar
  • 9
1 vote
2 answers
209 views

I'm trying to store a token from a login service in a variable, to retrieve it later and add it to the header in order to be able to consume more services from the API. I'm able to login and get the ...
Jose Luis Arrondo's user avatar
3 votes
1 answer
1k views

I Made a factory that keeps the information in my scopes in a series of 6 pages. Now when the user completes the 6th page and pushes the object I want the factory to reset to empty arrays again. I ...
Jurjen Folkertsma's user avatar
1 vote
3 answers
860 views

I have a factory: .factory('CompanyRolesResource', function($resource, FdConfig) { return $resource(FdConfig.routes.companyRoles); }) And I have a function that use this factory: ctrl....
rel1x's user avatar
  • 2,441
0 votes
1 answer
165 views

I've been given some AngularJS code that has a factory function that is called from a Directive that Posts a file to Web API. I'm having trouble passing the key that is returned to my controller. ...
Pete's user avatar
  • 123
9 votes
1 answer
791 views

Edit 1: Guys, I notice that I call $http.get('/posts') (for some special purpose) in my authentication factory. Sorry for the stupid question. I will delete it when the bounty is end. I have the ...
SoftTimur's user avatar
  • 5,770
1 vote
1 answer
405 views

I'm refactoring an old AngularJS project so it's less dumb and bad, separating controllers and exporting data with a factory rather than having all the data inside of one giant controller. I can't get ...
heatherblairs's user avatar
1 vote
2 answers
68 views

After migrating to AngularJS 1.6.3, I changed my services like below: Here is my service: MetronicApp.factory('MyService', ['$http', function($http) { return { get: function(id, success, ...
Burak's user avatar
  • 5,784
0 votes
2 answers
267 views

I'm trying to make a method that returns an array of objects after getting the objects from an API. The problem is that the return from the factory happens before all the calls are finished. I've ...
Knikedix's user avatar
0 votes
1 answer
559 views

I am new in angularJS and try to make a CRUD operation to clear my concept. I try to use angular factory but I google a lot and unable to find any solution on below concept. I just want to use my ...
user avatar
0 votes
1 answer
161 views

There is a register form. On submit of register form I am trying to save the data through angular service. It is giving me an error Error: [$http:badreq] This is my register.controller.js (...
rji rji's user avatar
  • 707
0 votes
3 answers
380 views

I am new to angular 1, and I have problem with my code: var app = angular.module("Football", []); app.factory("competitions", ['$http', function($http) { return $http.get("json/competitions.json")...
Michal's user avatar
  • 25
0 votes
1 answer
701 views

I have something challenging requirement and looking for solution to render it dynamically. I would request experts to help me on below requirement. I need to render the data as per the above format ...
Siva P's user avatar
  • 109
2 votes
5 answers
5k views

I'm trying to inject my factory into a controller. If I list the factory as one of the controller's parameters, I get this error: Error: [$injector:unpr] Unknown provider: wordRushFacProvider <- ...
Romulus3799's user avatar
  • 1,907
0 votes
1 answer
846 views

AngularJS : 1.4.X Scenario 1: Works fine Scenario 2: Throws 404 error on line xhr.send(isUndefined(post) ? null : post); in angular.js I'm trying to add inbuilt angular cache to our existing app, ...
Mad-D's user avatar
  • 4,709
1 vote
2 answers
1k views

I'm facing a new issue with AngularJS. Infact, since I need to have a "shared" variable, readable and updatable in 2 controllers, I thought about doing that with a factory injected in both the ...
Wendigo's user avatar
  • 484
0 votes
1 answer
688 views

I have the following code which is not working as expected, maybe because I am new on angular :) I want to re-call the same factory function whenever I append a new record to my database, because ...
David Aleixo's user avatar

1
2 3 4 5
9