[Common UI] Avoid infinite digest
Avoid infinite digest when first applicy mct-scroll directives, WTD-920.
This commit is contained in:
@@ -39,7 +39,7 @@ define(
|
||||
}
|
||||
|
||||
// Initialize state in scope
|
||||
updateScope();
|
||||
parsed.assign(scope, element[0][property]);
|
||||
|
||||
// Update element state when value in scope changes
|
||||
scope.$watch(expr, updateElement);
|
||||
|
||||
@@ -86,6 +86,11 @@ define(
|
||||
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();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user