Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DomPopupSourceFactory provider error when using material-dropdown-select

I am trying to use material dropdown select but I am getting this error:

EXCEPTION: No provider found for DomPopupSourceFactory.

The materialDirectives is added to the directives list, the html call is simple:

<material-dropdown-select></material-dropdown-select>

I tried the angular_components_example and it worked fine. The problem is with my project. I already tried to clean the .packages and executed the pub get. Nothing worked. I tried some other material components and they worked.

like image 933
Jonathan Avatar asked May 19 '26 05:05

Jonathan


1 Answers

If you add materialProviders to AppComponent it should work:

@Component(
  selector: 'my-app',
  directives: const <dynamic>[
    CORE_DIRECTIVES,
    materialDirectives,
  ],
  providers: const <dynamic>[
    materialProviders, // <<<<<<<<<<<<<<<<
  ],
)
class AppComponent {...}
like image 83
Günter Zöchbauer Avatar answered May 21 '26 05:05

Günter Zöchbauer