Skip to Content
avatar image
Former Member

how to refresh model in xml, js view after interval

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 14, 2017 at 09:02 AM

    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

    Add comment
    10|10000 characters needed characters exceeded