Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • I can't declare 'arrayofObj', I'm geting the following error Cannot find name 'arrayofObj' Commented Oct 29, 2017 at 16:01
  • You need to declare arrayofObj as a class variable (like you did for books and errorMessage). It should be arrayofObj: any[]; and then you access it with this.arrayofObj inside ngOnInit Commented Oct 29, 2017 at 16:06
  • Can you edit your question to show what you have now in your ts file and in your html ? Commented Oct 29, 2017 at 16:10
  • are you using forEach to iterate over books and then access arrayofObj ? Commented Oct 29, 2017 at 16:20
  • I don't understand your code, and some variables disappeared. What is retrivedata and newarray ? I am not sure if this is what you want to achieve, but you don't need to use a for loop inside your subscribe to get the books, you just assign it to a variable. Commented Oct 29, 2017 at 16:37