Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'themeClass' does not exist on type 'OverlayContainer'. #5

Closed
GuateDevIO opened this issue Sep 25, 2017 · 2 comments
Closed

Comments

@GuateDevIO
Copy link

I am currently getting the following error when running npm start: ERROR in C:/Users/....../angular-ngrx-material/src/app/app.component.ts (52,31): Property 'themeClass' does not exist on type 'OverlayContainer'.

As per the recent Angular Material changelog available here https://github.com/angular/material2/blob/master/CHANGELOG.md#200-beta11-carapace-parapet-2017-09-21

overlay: Now that the Overlay is part of the cdk rather than Angular Material directly, the themeClass property has been removed. To add a class to the overlay for theming, you can do

overlayContainer.getContainerElement().classList.add('my-theme-class');

Can you please help me with this issue. I think replacing this.overlayContainer.themeClass = theme; inside the app.component.ts with the above code will resolve the issue but I am afraid it may break other things in the App. Thanks in advance.

@tomastrajan
Copy link
Owner

Without checking the code (cant now) I think you troubleshooted the issue pretty well. I would not expect that to break anything else because that code was only concerned with that one thing.

Another thing is that now we probably have to import { OverlayContainer } from '@angular/cdk' instead of '@angular/material' feel free to try locally and run the app. If you can switch themes and dropdowns still work then thats the fix. U can try running tests and prod build too (see package.json for build.targets) Also feel free to create PR with the fix 😉 And thank you for your troubleahooting effort! Have a great day!

@tomastrajan
Copy link
Owner

Ok, was fixed in 1.13.0, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants