Get all enabled viewmodes of a entity/bundle I need to get all possible viewmodes of a specific entity/bundle in D8.
Currently I have this:

$viewmodes = \Drupal::service('entity_display.repository')-&gt;getViewModes($entity_type);


This shows all viewmodes on an entity, it doesn't filter on bundle.
Also, the default viewmode is never included here. 

Anyone knows a better way?

Cheers, Tom
What @googletorp said is correct. But there is a concept of "enabled" view modes, just not like you're apparently expecting.

Enabled view modes are view displays. Enabling a view mode for a given bundle creates a view display which then stores the formatter configuration.

Same for form modes and form displays.

And I think \Drupal\Core\Entity\EntityDisplayRepository::getViewModeOptionsByBundle() will kind of give you what you're looking for. The view modes for which the given bundle has a view display.