Skip to content

cdk should warn of missing doctype #8084

Closed
@isaacplmann

Description

@isaacplmann

Bug, feature request, or proposal:

Currently @angular/material warns if you don't add a doctype to your index.html, but the @angular/cdk does not. That warning should be moved from lib/common to the cdk.

What is the expected behavior?

Using the cdk OverlayModule warns you if you don't correctly set a doctype.

What is the current behavior?

No warning. There is only a warning if you import some module from @angular/material.

What are the steps to reproduce?

http://plnkr.co/edit/xX4SltIH9IbQHEHVvNyx?p=preview
This plunker does not import any material modules, but it does import OverlayModule from @angular/cdk. There should be a warning in the console. If you import any modules from @angular/material into the AppModule, there will be a warning about a missing doctype.

What is the use-case or motivation for changing an existing behavior?

I have a library that uses the cdk, but the overlay doesn't work correctly if there isn't a doctype specified. I want my users to be warned explicitly if they don't have that set.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

@angular/[email protected], angular 4.4.6

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: cdk/platform

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions