diff --git a/platform/features/listview/src/controllers/ListViewController.js b/platform/features/listview/src/controllers/ListViewController.js index 385ab635bc..456abec91c 100644 --- a/platform/features/listview/src/controllers/ListViewController.js +++ b/platform/features/listview/src/controllers/ListViewController.js @@ -32,6 +32,11 @@ define(function () { this.utc = formatService.getFormat('utc'); + //Trigger digestive cycle with $apply to update list view + setTimeout(function () { + $scope.$apply(); + }); + $scope.$on('$destroy', function () { unlisten(); }); diff --git a/platform/features/listview/test/controllers/ListViewControllerSpec.js b/platform/features/listview/test/controllers/ListViewControllerSpec.js index ea0a5e0ce8..d4b3638f5f 100644 --- a/platform/features/listview/test/controllers/ListViewControllerSpec.js +++ b/platform/features/listview/test/controllers/ListViewControllerSpec.js @@ -104,7 +104,7 @@ define( scope = jasmine.createSpyObj( "$scope", - ["$on"] + ["$on", "$apply"] ); scope.domainObject = domainObject; @@ -146,6 +146,7 @@ define( runs(function () { expect(scope.children.length).toEqual(0); }); + expect(scope.$apply).toHaveBeenCalled(); }); it("releases listeners on $destroy", function () { expect(scope.$on).toHaveBeenCalledWith('$destroy', jasmine.any(Function));