angularjs-service Questions
2
Solved
What is the lifecycle of a service (or factory) in angularjs and when is it re-initialzed ?
Monolingual asked 5/8, 2015 at 18:53
1
Solved
I made resource that receive records count from rest service as text plain. Angular makes an array of each chars from answer. For example if rest answers 20, angular will make array [2,0]. Can I fi...
Avebury asked 29/7, 2015 at 22:31
1
Solved
Hi I have a problem in laravel 5 existing validation.
In my controller and request.
class PostEmailRequest extends Request{
/**
* Get the validation rules that apply to the request.
*
* @retur...
Athodyd asked 29/7, 2015 at 12:40
1
I am trying to make a unit test for a service that uses $http. I am using Jasmine and I keep on getting this error:
TypeError: parsed is undefined in angular.js (line 13737)
This is what my se...
Violinist asked 20/11, 2014 at 19:57
1
Solved
I have a service like so:
app.service('Utilities', function() {
this.sum = function(items, prop) {
var count, total;
total = 0;
count = 0;
if (items === null) {
total = 0;
}
while (count &...
Surplus asked 18/7, 2015 at 16:24
2
Solved
I would like to define a constant which use $locale service. Constants are objects, so I can't inject it as parameter as in case of controller. How can I use it?
angular.module('app').constant('SO...
Ganiats asked 15/7, 2015 at 13:59
3
Solved
I am having a lot of trouble getting dependencies provided properly for an AngularJS service.
I see a number of other posts with similar errors here on StackOverflow but none of them seem to resol...
Reactor asked 6/1, 2014 at 18:21
2
Solved
I have an AngularJS service which communicates with the server and returns
translations of different sections of the application:
angular
.module('utils')
.service('Translations', ['$q','$http'...
Expectancy asked 30/1, 2015 at 14:25
1
Solved
I have a route to retrieve a single post and a service to query my API to do so. But I need to pass parameters from the URL to the service so that I can call the API properly. I cannot wrap m...
Dominick asked 25/6, 2015 at 17:25
3
I want to be able to tell whether an $resource instance has been modified by the user - that is, whether its current state is different than what has been initially loaded from the server &&...
Martyry asked 27/10, 2013 at 6:36
1
Solved
Maybe I'm missing some kind of property, but I'm follow this project and I'm getting this error in my controller.
TypeError: loginService.signin is not a function
This is my controller.js
angul...
Getupandgo asked 16/6, 2015 at 19:28
2
Solved
I am trying to put some default values in my directive with Isolate scope. Basically, I need to do some DOM manipulations using the scope object when my directive is bound. Below is my code:
Cont...
Willard asked 3/10, 2013 at 7:35
2
Solved
I am developing an angularjs app as a part of my angularjs learning. I have controllers and from there I am calling service layers.
leagueManager.service("teamsService", function($http){
...
Lagging asked 12/9, 2013 at 4:6
2
Solved
I am making a $http DELETE request with a payload but the content-type is wrong. I have a data object, but the content-type is getting set to text/plain instead of application/json. As you can see ...
Delimitate asked 18/7, 2014 at 16:36
1
Solved
I've testing AngularJS services in browser console during development for quick verification. The way I inject a service into console is as describe in this question or
var $inj = angular.injector...
Boscage asked 26/8, 2013 at 3:57
1
Solved
I have used two different controllers (assume: myCtrl1 and myCtrl2) and I set a button on myCtrl1. When we hit this button the action goes to myCtrl2 via ajax call. Now I'm append some data on .ser...
Cyrilcyrill asked 12/2, 2015 at 14:5
2
Solved
I have tried everything to get ui-router's resolve to pass it's value to the given controller–AppCtrl. I am using dependency injection with $inject, and that seems to cause the issues. What am I mi...
Vendace asked 13/1, 2015 at 3:25
2
Solved
I have a service that loads data using $http and returns a promise (simplified for brevity):
angular.module('myApp').factory('DataService', ['$http', function($http) {
function unwrapFriendList(d...
Prima asked 18/12, 2014 at 21:15
3
Solved
I'm trying to include a javascript libraries (actually, a handfull) into my AngularJS app. So far, I am building a stripped down version of this app, with no design. It's just all about functionali...
Stellite asked 4/2, 2014 at 17:19
1
Solved
I want to override value-
angular.module("data", []).value('apiBase', '/api1/data')
at runtime, I tried to modify it with-
angular.module("data").value('apiBase', '/someotherapi/data')
in so...
Spindly asked 25/11, 2014 at 9:19
2
Solved
I have a factory that is retrieving the data from an external source. As soon as i get the data, i use a second factory to filter it by a certain criteria.
The factory property is assigned to scop...
Gaullism asked 2/9, 2013 at 8:6
2
Solved
I currently have a service that is depending on a variable set in $cookies. However, when I want to unit test the interaction between the service and the value stored in $cookies, then the service ...
Darius asked 27/11, 2013 at 8:11
1
Solved
I have 3 controllers that do similar tasks:
PastController queries an API for past system outages.
CurrentController queries an API for current system outages
FutureController queries an API for ...
Commutable asked 14/11, 2014 at 0:36
2
Solved
I have two services - one to store user details and the other to make a call to retrieve those details:
userService stores user details to be used across the entire app (i.e. injected in controlle...
Unproductive asked 20/10, 2014 at 17:21
2
Solved
Scenario
I have a service UserService that maintains the (boolean) sessionStatus of the user.
The view conditionally shows [LOGOUT] on ng-show=sessionStatus (i.e. if not logged in (false), no sho...
Kilohertz asked 13/10, 2014 at 15:51
© 2022 - 2024 — McMap. All rights reserved.