[Common UI] Avoid infinite digest

Avoid infinite digest when first applicy mct-scroll
directives, WTD-920.
This commit is contained in:
Victor Woeltjen 2015-03-03 13:50:39 -08:00
parent 5df2710721
commit 86ee28740f
2 changed files with 6 additions and 1 deletions

View File

@ -39,7 +39,7 @@ define(
} }
// Initialize state in scope // Initialize state in scope
updateScope(); parsed.assign(scope, element[0][property]);
// Update element state when value in scope changes // Update element state when value in scope changes
scope.$watch(expr, updateElement); scope.$watch(expr, updateElement);

View File

@ -86,6 +86,11 @@ define(
expect(mockScope.$apply).toHaveBeenCalledWith(EXPRESSION); expect(mockScope.$apply).toHaveBeenCalledWith(EXPRESSION);
}); });
// This would trigger an infinite digest exception
it("does not call $apply during construction", function () {
expect(mockScope.$apply).not.toHaveBeenCalled();
});
}); });
} }
); );