Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

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
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • 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
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(