Skip to content

Commit 2f1fe03

Browse files
authored
fix(cdk/drag-drop): error if ngDevMode is undefined (#29634)
Fixes that the drag&drop module wasn't checking for `ngDevMode` correctly. Fixes #29633.
1 parent d0e178b commit 2f1fe03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cdk/drag-drop/drag-ref.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,10 @@ export class DragRef<T = any> {
829829
const parent = element.parentNode as HTMLElement;
830830
const placeholder = (this._placeholder = this._createPlaceholderElement());
831831
const anchor = (this._anchor =
832-
this._anchor || this._document.createComment(ngDevMode ? 'cdk-drag-anchor' : ''));
832+
this._anchor ||
833+
this._document.createComment(
834+
typeof ngDevMode === 'undefined' || ngDevMode ? 'cdk-drag-anchor' : '',
835+
));
833836

834837
// Insert an anchor node so that we can restore the element's position in the DOM.
835838
parent.insertBefore(anchor, element);

0 commit comments

Comments
 (0)