Assume I have a directive with name 'my-custom-directive' and component with name 'app.component' I have a method in app.component - createDirective() that will be invoked on click of a button from app-component.html I want to instantiate my-custom-directive from this method. how can this be done in angular2 & above?
I tried with Renderer2 but unable create directive from component