How to setup autoRefresh for AngularJS?
Answers
I have a scheduler that is setup via a $scope.config in an Angular directive. Works great but trying to enable autoRefresh per instructions and it is not working. I have the following code in this partial dump of a $scope.config. Can you help me discover how to make this work? I was not able to find a demo of autoRefresh for Angular so feel free to send url if there is one. My goal is to reload every 30 seconds to poll for changes from other users. If you have any recommendations on push as well let me know. Much appreciated. Thanks.
$scope.config = {
useEventBoxes: "Never",
snapToGrid: false,
allowEventOverlap: false,
onBeforeCellRender: function(args) {
if (args.cell.start.getDayOfWeek() === 5 || args.cell.start.getDayOfWeek() === 6) {
args.cell.backColor = "#f9f9f9"; //highlights Friday and Saturday as weekends
} else if (args.cell.start.getDayOfWeek() === 0) {
args.cell.backColor = "#ffffff"; // overrides default highlighting of Sunday
}
},
cssOnly: true,
scale: "CellDuration",
days: $scope.days,
width: "100%",
heightSpec: "Max",
height: $scope.windowHeight,
cellWidthSpec: "Auto",
cellDuration: 720, //720 for a half day, 1400 for a whole day
headerHeight: 40,
eventHeight: 35,
autoRefreshInterval: 10,
autoRefreshMaxCount: 10,
autoRefreshEnabled: true,
onAutoRefresh: function(args) {
alert("refreshing, " + args.i);