Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How to interact with my API


Hello themes i have a mMetronic angular demo and it's great but when i am trying bind *NgFor directive with a variable of objects that come from my APi the div with for on it won't appear and it disappear and {--bindings--} shows instead .
Thanks in advance .


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


It seems like you are encountering an issue with binding data from your API to the *ngFor directive in your Metronic Angular demo. The appearance of {--bindings--} suggests that there might be an error or an issue with the data binding.

Here are a few things to check and consider:

Ensure that the data you are fetching from your API is in the correct format and structure. It should be an array of objects if you are using *ngFor to iterate over it.

If you are fetching data asynchronously, make sure to use the Angular async pipe in your template. For example:

<div *ngFor="let item of items$ | async">{{ item.property }}</div>

Check the console for any error messages. Angular might provide helpful error messages that can pinpoint the issue.

Ensure that your template syntax is correct. Double-check the usage of curly braces, parentheses, and square brackets.

If you are using *ngIf along with *ngFor, ensure that the conditions are met for the elements to be displayed.

If the issue persists, you might want to provide a snippet of your code (especially the part where you are using *ngFor), so I can offer more specific assistance.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(