title: What is the proper way to add [ngClass] to host element programmatically if element was created dynamically?
body: <p>I have dynamically created element</p>
  
  <pre><code>initElem() {
  let childElFactory = this._cfRes.resolveComponentFactory(childElCmp);
  // _cfRes is ComponentFactoryResolver
  let childElRef = this._vcRef.createComponent(childElFactory);
  // _vcRef is ViewContainerRef
  childElRef.instance.childElModel = someModel;
  }
  </code></pre>
  
  <p>and I want to add </p>
  
  <pre><code>[ngClass]="{active: childElModel.active}"
  </code></pre>
  
  <p>attribiute and</p>
  
  <pre><code>#childEl
  </code></pre>
  
  <p>attribiute to host element of childElCmp.</p>
  
  <p>I don't want to use elementRef as it's not a proper way.
  I think Renderer is what I am looking for but I don't know how to use it in the right way. </p>