0

is there a way I can get my "# content" variable in my app.module.ts file?

My file of example in HTML

   <div #content>
      .....
   </div>

My file of example app.module.ts

    //How do I get my variable here?
Stefan
  • 14,826
  • 17
  • 80
  • 143

1 Answers1

3

You can access it with:

@ViewChild('content') content: ElementRef;

A more indepth look is here: https://medium.com/@toannm4/angular-nativeelement-how-to-read-nativeelement-using-viewchild-cdf4a0970482

Stefan
  • 14,826
  • 17
  • 80
  • 143