- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 02:49 AM
Hi guys.I am trying to auto refresh the widget for each 5 seconds without refreshing the page.
I have tried the following client script,but it works only on page load not refreshing automatically for each 5 seconds.
function($scope,$timeout,spUtil) {
var c = this;
$timeout(function(){
spUtil.update($scope);
alert();
}, 5000);
}
If I use the `$interval` with `$scope.reload` instead `spUtil.update($scope);` I am getting an error `$scope.reload is not a function`.But it throws alert for each 5 second.
function($scope,$timeout,$interval,spUtil) {
var c = this;
$interval(function(){
//$scope.reload();
alert();
}, 5000);
}
So how can I auto refresh a particular widget?
Any help? Thanks!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 04:39 AM
Guys got solution.
function($scope,$timeout,$interval,spUtil) {
var c = this;
$interval(function(){
console.log("------working------")
spUtil.update($scope);
}, 3000);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 02:56 AM
have you checked this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 02:59 AM
Yes, Thats why I have used $timeout.But it does't work for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 03:09 AM
Please check my updated question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 04:39 AM
Guys got solution.
function($scope,$timeout,$interval,spUtil) {
var c = this;
$interval(function(){
console.log("------working------")
spUtil.update($scope);
}, 3000);
}