1

After HTML loaded I can select any HTML element using ElementRef.nativeElement.querySelector() so how to apply directive on selected element?

Tomislav Stankovic
  • 3,080
  • 17
  • 35
  • 42
  • 1
    Welcome to SO! Please go through the [tour](https://stackoverflow.com/tour) and a ask a question with a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). Share what you have done so that it helps people to understand your issue and help you out. – Vishaal Shankar Mar 23 '18 at 12:46

1 Answers1

1

As of Angular 5, you are not able to add directives to an element dynamically. This is potentially the same or a related question.

Sam Herrmann
  • 6,293
  • 4
  • 31
  • 50