The New Way to Build! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Learn More

There is a problem with updating the template content via a variable.


Good day, the problem is that I make a get request, the data comes slowly and they do not have time to load together with the template, and the variable having a new value does not update it in the template. And this happens only in metronic 8 (as a confirmation, a link to the code that shows what I want to implement - ?file=/src/app/app.service.ts). At the same time, the template updates the data to the new variable data, provided that I click on routelink. How can this be fixed?


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 (2)


If you're having trouble updating the template content via a variable, it might be due to how the variable is being referenced or formatted. Make sure the variable syntax matches the template's expected format. For instance, if you're working with dynamic content, double-check the placeholders. Also, if you’re using Adron Fence PVC fence options in your project, ensure the variable correctly pulls the desired specifications to display accurate fence details.



Hi,
Looks like it's the cause of the ChangeDetection strategy.
Try to follow the article:
You also have to trigger this.cd.detectChanges(); after you are getting/updating data.

Regards,
Keenthemes support


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
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  :(