1

I have a simple HTML template built with MDL.

When I place the template into Angular2 App. Elements' actions and clicks are not working

E.g : Showing dropdowns or clicking tabs etc are not working.

I cant see any errors in Developer Console and would like clarification on why this error is happening.

ValarMorghulis
  • 79
  • 1
  • 13
Sergino
  • 10,128
  • 30
  • 98
  • 159

1 Answers1

1

Call componentHandler.upgradeDom(); in ngAfterViewInit() and each time later when the DOM was modified:

ngAfterViewInit() {
  componentHandler.upgradeDom();
}

See also Material Design Lite tooltips not working with Angular 2

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567