-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Container element must be an existing DOM element. #6
Comments
@cwqt Thanks for reporting this issue! This error is coming from Muuri itself and from reading the error message, it looks like there isn't any element in the DOM that Muuri can bind to. Could you provide a Stackblitz example with your code, so I can see if I can reproduce the error? Thanks in advance! |
It's just the code from the readme but in a different component than app-root, can't provide a stackblitz but here's the source: https://gitlab.com/cxss/mcn/-/tree/master/frontend/src/app/routes/index/dashboard |
I have managed to get this to work by using <div *ngIf="ready">
<div muuriGrid class="grid" [config]="layoutConfig">
<div class="grid-item" muuriGridItem *ngFor="let item of blockItems">
<div class="grid-item-content">
{{ item }}
</div>
</div>
</div>
</div> ngOnInit(): void {
setTimeout(() => {
this.ready = true;
}, 0);
} Would appear to be some kind of race condition going on with the directive |
I am guessing your grid div is just not available within the angular life-cyle hook. Maybe move your
Does this help..? |
After copying demo code - getting this error on Angular CLI: 9.0.2, Node: 10.15.0
The text was updated successfully, but these errors were encountered: