The answer to your question is that you use nested promises, which isn't the best idea. The main concern here is that two XHR calls is (by definition) twice as slow as a single call.
What I would recommend is actually making the API return a short summary of the details page in addition to `ref` and `description`. This way, you only make a single call. On Sat, Apr 12, 2014 at 11:04 AM, Mauro Servienti <[email protected]> wrote: > Hi all, > > > > Let’s say that I have a remote api the when called using something like > “/api/search?q=foo” returns something like: > > > > { > > Results: [{ > > ‘ref’: ‘/api/companies/12’, > > ‘description’: ‘sample company’ > > }] > > } > > > > The above are search results, and the server is telling me where to go to > retrieve details about the returned documents. > > Now my requirement is to navigate to a page within my application to > display details about the selected result, with the requirement that the > details page must be “bookmarkable”. > > > > The above “ref” value is not a client side uri, it identifies the resource > for the remote server, in which way I can do some sort of mapping to route > the request client side? > > And more: when I route the request on the client how can I matain the ref > value somewhere to to know what/where to call in the details page? > > > > Cheers, > > .m > > -- > 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. > -- *James Brewer* *http://www.brwr.org/ <http://www.brwr.org/>* *Software Engineer @ RealScout | What is RealScout? <http://vimeo.com/72791570>* *Twitter* *twitter.com/jamesbrwr <http://twitter.com/jamesbrwr>* *GitHub* *github.com/brwr* <http://github.com/brwr> *StackOverflow** stackoverflow.com/users/2052923/james-brewer <http://stackoverflow.com/users/2052923/james-brewer>* *LinkedIn* *linkedin.com/in/jamesbrwr <http://linkedin.com/in/jamesbrwr>* → *M**y favorite RealScout search is Modern & High-Tech Homes in Atherton <https://kendeleon.realscout.com/categories/modern-high-tech?utf8=%E2%9C%93&loc=Atherton>* -- 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.
