Issue #1818Opened February 20, 2019by mcrodrig2 reactions

[Question]: Making grapesjs working with angular7 and material

Question

I'm trying to integrate the library with Angular7, but got problem when moving container <div id="gjs"></div>into the material component (stepper) in this case.

I put my code in https://stackblitz.com/edit/angular-qa6gqz (error with grapesjs doesn't happen in my local environment).

<mat-horizontal-stepper labelPosition="bottom" [@.disabled]="true">
    <mat-step label="Template management" [completed]="false">
      TEMPLATES
    </mat-step>
    <mat-step label="Edit the template" [completed]="false">
        <div id="gjs"></div>              <- Doesnt show
        <div id="blocks"></div>
    </mat-step>
    <mat-step label="Test and Save" [completed]="false">
        <div>
            <button mat-raised-button (click)="saveTemplate()" id="save-template">
                Save
            </button>
        </div>
    </mat-step>
</mat-horizontal-stepper>
        <div id="gjs"></div>          <- Shows
        <div id="blocks"></div>
<router-outlet></router-outlet>

Can you helkp?

Answers (2)

mcrodrigFebruary 21, 20192 reactions

For future reference: Problem was related to executing the grapesjs.init call before the html was rendered and the <div> inside the mat-step was not available.

lock[bot]February 21, 20200 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.