Dynamic lazy loading component

 https://johnpapa.net/angular-9-lazy-loading-components/



async getLazy1() {

    this.viewContainerRef.clear();

    const { Lazy1Component } = await import('./lazy1.component');

    const compFactory= this.cfr.resolveComponentFactory(Lazy1Component)

    this.viewContainerRef.createComponent(compFactory);

  }

import { Component, OnInit, ViewContainerRef, ComponentFactoryResolver } from '@angular/core';
import { Lazy2aComponent } from './lazy2a.component';
import { Lazy2bComponent } from './lazy2b.component';

  constructor(

    private viewContainerRef: ViewContainerRef,

    private cfr: ComponentFactoryResolver

  ) {}


  ngOnInit() {

    const componentFactorya = this.cfr.resolveComponentFactory(Lazy2aComponent);

    const componentFactoryb = this.cfr.resolveComponentFactory(Lazy2bComponent);

    this.viewContainerRef.createComponent(componentFactorya);

    this.viewContainerRef.createComponent(componentFactoryb);

  }

Python-1

Python Revision Notes - Comprehensive Study Guide Section 1: Python Environment Setup 4. Different Ways of Creating Python Environment [...