D
D
Django Almighty2020-05-04 19:17:46
Angular
Django Almighty, 2020-05-04 19:17:46

How to gracefully load a module in Angular without visual delay?

There is a rather heavy component, with the ckeditor module (visual html code editor). When I click on a page transition, I have a freeze for 2 seconds before the transition.

Here is the code for the component I'm switching to:

import * as ClassicEditor from '../../../assets/ckeditor-custom/ckeditor.js'

@Component({
  selector: 'app-html',
  templateUrl: './html.component.html',
})
export class HTMLComponent implements AfterContentInit {
  
  editor : any;

  ngAfterContentInit() : void
  {
    this.editor = ClassicEditor;
  }


this.editor = ClassicEditor;this block freezes for 2 seconds. It is clear that at this time it imports the module, and only then renders the component. How to perform, first the transition and only after that the loading of the module?

In html, the *ngIf="editor" condition has no effect.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question