Hi, 

I'm not entirely sure that I understand your question, but I'll try to give 
some pointers.

There are subtle differences between native javascript and angular 
expressions <https://docs.angularjs.org/guide/expression>.  Importantly, 
angular expressions are forgiving.  From the docs:


   - 
   
   Forgiving: In JavaScript, trying to evaluate undefined properties 
   generates ReferenceError or TypeError. In Angular, expression evaluation 
   is forgiving to undefined and null.
   
Put another way:

If you have an object a, which has a property b

a = {b:"foo"}

Then

*In Javascript:*
a.b.c is undefined

*As an angular expression:*
{{a.b.c}} evaluates to nothing

*In Javascript:*
a.b.c.d will give you a TypeError

*As an angular expression:*
{{a.b.c.d}} evaluates to nothing

So may want to consider putting
{{query.results.quote.Volume}} 

as an angular expression to avoid the nasty if then else logic that you 
would have to write for every property to guard against error (if you were 
unsure if they existed). 

Regards
Justin 


On Friday, October 17, 2014 4:08:25 PM UTC+2, drisak wrote:
>
> Hi,
> Trying to learn, so this is probably really basic but here we go.
>
> How do I drill down in the result, to extract specific information.
>
> In this exaple I have a REST query from Yahoo
>
> https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quote%20where%20symbol%20%3D%20%22AAPL%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
>
> I can get the value for "created" with a function like this.
> this.getCreatedTime = function() {
>         return this.data && this.data.query ? this.data.query.created : 
> null;
>       }
>
> But how do I extract info deeper down, lets say I want the value for 
> "Volume" (query > results > quote > Volume).
>
>
> Thanks
> II
>

-- 
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