Skip to content
Advertisement

Angular: How to refresh a part of html ( form / div / table )

I have a page for create operation. In my page I have 1 form with 2 field. If I reload the page (or window.reload by code) I can see updates in that form. But I want to trigger a refresh on the form by pressing button click.

So please help me to write a function that can refresh the form (or any other html element like tabe/paragraph/etc.)

.html of my form:

JavaScript

the function should be called by clicking Save button

Advertisement

Answer

You could use ngOnChanges()

Example:component.ts file

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement