title: Dom element not found in lazy loaded angular component
body: <p>I have a nebular stepper component and for the final step, I lazy load the component. In that component, I need to identify an element by id and make changes to it.</p>
  <p>Stepper component where lazy loading takes place:</p>
  <p>Html-</p>
  <pre><code> &lt;nb-step [label]=&quot;labelFour&quot;&gt;
            &lt;ng-template #labelFour&gt;Fourth step&lt;/ng-template&gt;
            &lt;h3&gt;Edit Your Image&lt;/h3&gt;
            
            &lt;div class=&quot;container step-container&quot;&gt;
                &lt;ng-template #canvasContainer &gt;&lt;/ng-template&gt;
                
              
            &lt;/div&gt;
  
  
            &lt;button nbButton nbStepperPrevious&gt;prev&lt;/button&gt;
            &lt;button nbButton nbStepperNext&gt;next&lt;/button&gt;
  &lt;/nb-step&gt;
  </code></pre>
  <p>TS-</p>
  <pre><code>  @ViewChild('canvasContainer', {read: ViewContainerRef}) canvasContainer: ViewContainerRef;
    canvasInitialized = false;
  
    async createCanvas() {
      await this.lazyLoadCanvas();
      this.canvasInitialized = true;
      
    }
    private async lazyLoadCanvas() {
      const {CanvasComponent} = await import('../../single/canvas/canvas.component');
  
      const canvasFactory = this.cfr.resolveComponentFactory(CanvasComponent);
      const {instance} = this.canvasContainer.createComponent(canvasFactory, null, this.injector);
      
  
    }
    noDesignSelected:boolean;
    thirdStepNext(){           //Third step is clicked
     
      if(this.postDesignService.designID != -1){
        this.stepper.next();
        this.noDesignSelected = false;
        this.createCanvas();
      } else {
        this.noDesignSelected = true;
      }
      
    }
  </code></pre>
  <p>Component that's loaded in-</p>
  <p>Html-</p>
  <pre><code>&lt;div class=&quot;canvas-bg&quot;&gt;
      &lt;div id=&quot;container&quot; &gt;&lt;/div&gt;
  &lt;/div&gt;
  
  </code></pre>
  <p>TS-</p>
  <pre><code>ngAfterViewChecked() {
      document.getElementById('container').classList.add('test');   //error here
  
      this.stage = new Konva.Stage({
        container: 'container',            //error here
        width: this.stageWidth,
        height: this.stageHeight,
      });
  }
  </code></pre>
  <p>The error tells me that an element with id 'container' can't be found.</p>
  <p>I've tried ngOninit, ngAfterViewInit, and ngAfterViewChecked (as seen above). I've tried assigning the element to a Viewchild and changing the style of that viewchild.</p>