[Folder] List view load fix (#2069)

* [Folder] List view load fix

-List view data takes long time to display, has to do with Angular not triggering its digestive cycle when switching views
-Resolved issue by explicitly triggering the digestive cycle
-Fixes issue #2067

* Added comment to clarify code addition

fix #2069
This commit is contained in:
Julie Wang 2018-06-21 10:52:27 -07:00 committed by Pete Richards
parent 45a152df86
commit b187762d55
2 changed files with 7 additions and 1 deletions

View File

@ -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();
});

View File

@ -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));