mirror of
https://github.com/nasa/openmct.git
synced 2025-04-07 11:26:49 +00:00
[Layout] Avoid infinite digest error
Perform initial population of scope in mct-representation at link time, instead of waiting for watches to be fired; this avoids the need for extra digest iterations, which Angular detects as indicators of infinite loops (throwing exceptions accordingly.) Fixed in the context of supporting transition of editable Layouts, because these errors were being thrown upon exiting Edit mode. WTD-535.
This commit is contained in:
parent
b1457c9eaf
commit
874efa40ea
@ -131,6 +131,12 @@ define(
|
||||
// same domain object; these changes should be tracked in the
|
||||
// model's "modified" field, by the mutation capability.
|
||||
$scope.$watch("domainObject.getModel().modified", refresh);
|
||||
|
||||
// Do one initial refresh, so that we don't need another
|
||||
// digest iteration just to populate the scope. Failure to
|
||||
// do this can result in unstable digest cycles, which
|
||||
// Angular will detect, and throw an Error about.
|
||||
refresh();
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user