447 questions
1
vote
0
answers
31
views
AngularJs - How to update Internal data within a Factory?
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. ...
-1
votes
1
answer
50
views
How can I implement caching in angularJs factory?
How can I implement caching in the angularJs factory without using cacheService?
1
vote
0
answers
72
views
AngularJS - How to construct the url of endpoint with 2 parameters
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 ...
0
votes
1
answer
974
views
Migrating an AngularJS factory to TypeScript
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 ...
0
votes
1
answer
109
views
How to use module function inside another factory in angularjs
I have configurations.js file which having
var configurationModule = angular.module('configuration', ['restangular', 'notification']);
configurationModule.factory('clientConfigSvc', function (...
0
votes
1
answer
79
views
Propagating Scope Events from a Factory
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.$...
0
votes
0
answers
77
views
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 ...
6
votes
1
answer
538
views
AngularJS injecting third party module ngIdle
I have a controller as shown below.
(function () {
"use strict";
var app = angular.module('Demo')
.controller('MainController', ['$rootScope', '$scope', '$location', 'curUser',MainController]);
...
0
votes
1
answer
88
views
AngularJS Error, "Cannot read property of unknown"
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 ...
1
vote
2
answers
474
views
Syntax error in openweathermap API request
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', [...
0
votes
1
answer
275
views
Not able to call factory method after including factory function with $provide.factory in angular.js
app.config(['$controllerProvider','$compileProvider', '$filterProvider', '$provide',function($controllerProvider,
$compileProvider, $filterProvider, $provide) {
app.register = {
...
0
votes
2
answers
39
views
AngularJS - Why does my factory not update the DOM?
In my html I have:
<body ng-app='myApp'>
<h1 ng-controller='controller'>
{{YesOrNo}}
</h1>
<div ng-controller='controller'>
<span>{{YesOrNo}}&...
0
votes
2
answers
63
views
Error: "fourSquareService.getVenues is not a function"
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 ...
0
votes
2
answers
57
views
AngularJS - Factory from Controller - not getting value from $http.get
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("...
0
votes
0
answers
109
views
AngularJS .then() function is not returning data after getting successful response [duplicate]
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. ...