After HTML loaded I can select any HTML element using ElementRef.nativeElement.querySelector()
so how to apply directive on selected element?
Asked
Active
Viewed 67 times
1

Tomislav Stankovic
- 3,080
- 17
- 35
- 42

Aakash Prajapati
- 11
- 1
-
1Welcome 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 Answers
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