9
votes
3answers
118 views

Should services expose their asynchronicity?

I'm writing a service that will retrieve data asynchronously ($http or $resource). I can hide the fact that it is asynchronous by returning an array that will initially be empty, but that will ...
12
votes
4answers
1k views

angular js - configuration for different enviroments

how do you manage configuration variables/constant for different enviroments? This could be an example: my rest api it's reachable on localhost:7080/myapi/, but my friend that works on the same ...
2
votes
1answer
88 views

Angular Service Defination: service or factory

I am an angular newbie, I am building an application, one thing really puzzling me is there are couple of ways of defining a service, and I read more from this link: How to define service then it ...
2
votes
1answer
124 views

Dirty checking with shared service between controllers, One way works the other does not?

While attempting to answer a question regarding sharing data between two separate controllers I ran into a question . I usually use services for for this task and began to create a jsfiddle, but I ...
7
votes
2answers
3k views

AngularJS - The correct way of binding to a service properties

I’m looking for the best practice of how to bind to a service property in AngularJS. I have worked through multiple examples to understand how to bind to properties in a service that is created using ...
1
vote
3answers
763 views

AngularJS factory http returns empty

I'm trying AngularJS for the first time. I'm getting JSON data from a http-get request using a factory, but the object is returned empty, before the ajax-request is done. Factory: ...
0
votes
2answers
698 views

Sharing data between AngularJS services

Is there a way to share data between services in AngularJS? Use case: data aggregation from different services For example I want a service1 that loads some data from a REST Service. Then another ...
1
vote
1answer
148 views

AngularJS - AlertFactory open dialog behavior

i'm creating an AlertFactory because ui.bootstrap.dialog doesn't works in my app. So i type follow code: http://jsfiddle.net/Premier/BHqKB/17/ enter code here It works very well if you click on ...
0
votes
2answers
59 views

Angularjs - Declaring factory with a single object with a nested array - getting ReferenceError: … is not defined

I have a factory with several different methods and I am trying to declare an object that has an array nested in it. That one nested array will be the main driving force for my app and it will have ...
0
votes
1answer
57 views

Using angularjs service ($cookies) in factory registered using couchpotato

I'm using angularjs with couchpotato for help with lazy loading. My question is how do I reference angularjs services like $http, $cookies in my service registered using couchpotato? The normal ...
0
votes
3answers
149 views

$watch not working on variable from other controller?

I have one controller which displays a checklist, and stores the selection in an array. My other controller runs an $http.get on the array from the first controller. How do I set a $watch so that ...
0
votes
1answer
2k views

How to enable cors request with angular.js-resource

I have an angular.js application and i need to do CORS request. I want to define my rest services "the angular" using angular resources, described here: http://docs.angularjs.org/tutorial/step_11. ...