[SalesForce] use $A.createComponent() in the controller

I know that Lightning Components may not modify the DOM in the controller in order to pass the Appexchange Security Review. I need to create a new component with $A.createComponent() and I can't invoke this in my component's renderer.

The lightning developer guide has an example where $A.createComponent() is invoked in the controller and I want to know if this will satisfy the no DOM modification in the controller requirement, since rendering occurs when a component is created.

Best Answer

Yes, you can. The rendering in the component you created is happening in that component's renderer, not in your controller.

Related Topic