[Angular] Object array to array variable

11 views
Skip to first unread message

jamester go

unread,
Jul 12, 2018, 10:59:12 PM7/12/18
to ang...@googlegroups.com
Hi Guys


I wanted to handle the objects in a variable and use it in a method,
but whenever i tried fetching the data it's either undefined or [Object][Object]
can you help me with this. or me give a good example in handling this type of 
pattern

thanks in advance

Sander Elias

unread,
Jul 13, 2018, 2:48:36 AM7/13/18
to Angular and AngularJS discussion
Hi Jamester,

Sorry to say, but you are not giving me any clues that enable me to help you. Can you give a code example?

Regards
Sander

jamester go

unread,
Jul 13, 2018, 2:51:42 AM7/13/18
to ang...@googlegroups.com
Hi ahm


Sorry for my vague question, what I want is to read an array of data using httpget and check a data in a variable if it exist in the one of the data in the array

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

Sander Elias

unread,
Jul 13, 2018, 2:57:59 AM7/13/18
to Angular and AngularJS discussion
Can you make up some sample data, and show us what it is you want to accomplish?

Marcos Feijó Felipe

unread,
Jul 13, 2018, 7:56:06 AM7/13/18
to Angular and AngularJS discussion
I had the same problem using the $resource, and the answer was create a var with the $promise and after use the then.
You should try, puting your object in the place of "response"

var promise = this.response.$promise;
                promise.then(data => {
                    console.log(data[0].status);
                    console.log(this.response[0].status);
                });
Reply all
Reply to author
Forward
0 new messages