[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:
Victor Woeltjen 2014-12-05 15:22:14 -08:00
parent b1457c9eaf
commit 874efa40ea

View File

@ -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 {