I can't seem to use DOM methods such as "document.getElementById" and others in my Angular project. I've added the name of the .js script in angular.json, but it won't work. Any help would be appreciated.
Asked
Active
Viewed 39 times
1 Answers
0
You can try using: @ViewChild('yourId') yourElementName: ElementRef
which is what you should use in angular.
The htlm would look like <div #yourId></div>

ukn
- 1,723
- 1
- 14
- 24