Skip to content

Itemize sanity checks #16617

Closed
Closed
@mina-skunk

Description

@mina-skunk

Feature Description

Change type that MATERIAL_SANITY_CHECKS provides from boolean to:

interface SanityChecks {
  doctype: boolean;
  theme: boolean;
  version: boolean;
  hammer: boolean;
}

or even type boolean | SanityChecks for backwards compat

Use Case

We dynamically add the theme scss based on the user, this causes the warning

console.warn(
'Could not find Angular Material core theme. Most Material ' +
'components may not work as expected. For more info refer ' +
'to the theming guide: https://material.angular.io/guide/theming'
);

because the theme is not loaded yet when this code runs. Currently, to disable the warning we:

{ 
  provide: MATERIAL_SANITY_CHECKS, 
  useValue: false 
}

although the other checks could still be useful, if you could do

{ 
  provide: MATERIAL_SANITY_CHECKS, 
  useValue: {
    doctype: true,
    theme: false,
    version: true,
    hammer: true
  }
}

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions