Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ron Gregg 2 posts 72 karma points
    Jan 20, 2019 @ 08:13
    Ron Gregg
    0

    Custom Property Editor v7 - Update $scope.model every X seconds

    I created a custom property editor but I need to update the $scope.model every 5 seconds.

    I tried...

    angular.module('umbraco').controller('ListController', function ($scope, $log, $timeout, $interval, $filter, editorState, listResource) {
    
    $interval(function () {
        listResource.getList().then(function (response) {
            $scope.mylist = response;
        });
    }, 5000); });
    

    The 'listResource.getList()' function works fine but when I wrap it in a $interval it doesn't seem to work. I'm getting an Angular error:

    Error: Unknown provider: $intervalProvider <- $interval

    Anyone know how to accomplish this?

  • Ron Gregg 2 posts 72 karma points
    Jan 20, 2019 @ 08:29
    Ron Gregg
    0

    I believe I solved this issue.

    The Umbraco version I'm running is 7.4.3 which runs angular 1.1.5 which does NOT support $interval. I had to use create a function with calls itself every X seconds using $timeout instead.

    Hope this helps someone.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies