Skip to Content
0

how to refresh model in xml, js view after interval

Feb 14, 2017 at 08:44 AM

137

avatar image

Hi,

I want to have auto refresh into my UI, I’m using XML and javascript. Here is the case: I’m reading the data and filling the model(viewModel) with this data, then I build the view using this model. As into the backend the data will be changed, at some point, I want to have some kind of timer used to refresh the data automatically. I have looked for a standard solution, but for now I can’t find one. If you have any suggestion, please share.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Akhilesh Upadhyay Feb 14, 2017 at 09:02 AM
0

to achieve this you can use nameless function with setInterval, as below

//inside oninit,component file or any particular function
setInterval(function(){
   // code for model refresh
   alert('Model refreshed after 5000 MS');
},5000);

-Akhilesh

Share
10 |10000 characters needed characters left characters exceeded