[AngularJS] Re: Pass a variable from a http call to another

2014-04-28 Thread Charlie Camus
Thanks to all, I will follow your advices and try to learn some more about the 'promises'. Thanks Le vendredi 25 avril 2014 17:12:03 UTC+2, Charlie Camus a écrit : > > Hi all, > > I'm a beginner with Angular JS, and I think I missed something. > > Here is my code : > > $scope.listAccueil=functio

[AngularJS] Re: Pass a variable from a http call to another

2014-04-25 Thread Billy Figueroa
As mentioned above you can either use a .success callback or use a promise with .then to pass data. If you are not familiar with it do some research and study it a little bit On Friday, April 25, 2014 11:12:03 AM UTC-4, Charlie Camus wrote: > > Hi all, > > I'm a beginner with Angular JS, and I t

[AngularJS] Re: Pass a variable from a http call to another

2014-04-25 Thread Gabriel Aszalos
Also, you have to understand how an async request works. params is empty because the request is not completed. params will only be available once the success function is called AFTER the request is successful. Like I previously said - you'll have to do a bit of research and spend some time lear

[AngularJS] Re: Pass a variable from a http call to another

2014-04-25 Thread Gabriel Aszalos
What you are looking for is `promises`. $http returns a promise which you can chain on to. Just look into the guide for the $q service and watch some clips on chaining promises (on egghead.io for example). Its a very elegant way of doing what you want and I'm sure you'll find it very useful. On