How to set values to angular material Constants like SELECT_PANEL_MAX_HEIGHT

Viewed 2038

How to assign value to the Angular Material Constants like SELECT_PANEL_MAX_HEIGHT Which are provided in the official angular Material Documentation here

3 Answers

Constants such as SELECT_PANEL_MAX_HEIGHT is read only. You can only override options which have a special Injection token. For example: MAT_TOOLTIP_DEFAULT_OPTIONS for Material tooltip.

import { MAT_TOOLTIP_DEFAULT_OPTIONS } from "@angular/material";

...

providers: [
    {
        provide: MAT_TOOLTIP_DEFAULT_OPTIONS,
        useValue: {
            showDelay: 500,
            hideDelay: 300
        }
    }
]
Related