Justin Wong  was your problem solved, i'm stuck wih this kind of problem, 
could you post this if u have solved this issue

On Monday, February 4, 2013 at 11:59:54 PM UTC+5:30, Justin Wong wrote:
>
> Thanks Pawel!
>
> I've tried some different implementations and I think the example where 
> you chain the promises is the way to go.
>
> Cheers,
> Justin
>
>
> On Monday, February 4, 2013 12:23:27 AM UTC-8, Pawel Kozlowski wrote:
>>
>> Hi! 
>>
>> From top of my head I don't think it works like this, I mean, I don't 
>> think you can inject results of one resolve function to another one. 
>> Did you try out your solution? 
>>
>> IMO you will need to chain promises if a second call depends on 
>> results of the first one. Something along those lines: 
>>
>> { 
>>   resolve: { 
>>      combinedResults = function(Phone) { 
>>         return Phone.get(id).then(function(phoneResult){ 
>>            //do another call here based on results 
>>         }); 
>>      } 
>>   } 
>> } 
>>
>> A word of warning - if you happen to use $resource support for 
>> promises is only in master, wasn't released yet. 
>>
>> Ah, and the last (most important?) thing: you define the 'resolve' 
>> property on a route level, not a controller's property! 
>>
>> Cheers, 
>> Pawel 
>>
>>
>> On Mon, Feb 4, 2013 at 5:36 AM, Justin Wong <[email protected]> wrote: 
>> > Hello! 
>> > 
>> > I'm not sure if I'm thinking about the $routeProvider resolve property 
>> > correct or not. 
>> > 
>> > Here's the StackOverflow answer I'm following: 
>> > http://stackoverflow.com/a/11972028/765178 
>> > As you can see, phones is resolved then injected into the controller 
>> before 
>> > the route changes. 
>> > 
>> > I understand that part and got it to work. 
>> > 
>> > But now I want to have another dependency that depends on a phone that 
>> was 
>> > selected. 
>> > For example, I want to fetch the phone and all the carriers that the 
>> phone 
>> > is on. 
>> > 
>> > PhoneListCtrl.resolve = { 
>> >   phone: function(Phone) { 
>> > 
>> >   }, 
>> >   carriers: function(phone) { 
>> >   } 
>> > } 
>> > 
>> > 
>> > Is this possible or am I thinking about this problem wrong? 
>> > 
>> > Thanks! 
>> > Justin 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "AngularJS" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to [email protected]. 
>> > To post to this group, send email to [email protected]. 
>> > Visit this group at http://groups.google.com/group/angular?hl=en-US. 
>> > For more options, visit https://groups.google.com/groups/opt_out. 
>> > 
>> > 
>>
>>
>>
>> -- 
>> Looking for bootstrap-based widget library for AngularJS? 
>> http://angular-ui.github.com/bootstrap/ 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to