-2

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.

geteds
  • 79
  • 10
  • 1
    Possible duplicate of [Where does DOM manipulation belong in Angular 2?](https://stackoverflow.com/questions/37376442/where-does-dom-manipulation-belong-in-angular-2) – JJJ Aug 27 '18 at 11:17

1 Answers1

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