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

createOverlayContainer is not a function after upgrading to 7.2 #1050

Closed
drager opened this issue Aug 15, 2016 · 3 comments
Closed

createOverlayContainer is not a function after upgrading to 7.2 #1050

drager opened this issue Aug 15, 2016 · 3 comments

Comments

@drager
Copy link
Contributor

drager commented Aug 15, 2016

Bug

I just updated Angular material 2 to 7.2 from 6.0 and now the application wont start up. It throws the following error: createOverlayContainer is not a function. This is the following code I have when I'm bootstraping:

import {bootstrap} from '@angular/platform-browser-dynamic'
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser'
import {HTTP_PROVIDERS, Http} from '@angular/http'
import {provide} from '@angular/core'
import {Renderer} from '@angular/core'
import {APP_BASE_HREF} from '@angular/common'
import {disableDeprecatedForms, provideForms} from '@angular/forms'
import {OVERLAY_CONTAINER_TOKEN} from '@angular2-material/core/overlay/overlay'
import {createOverlayContainer} from '@angular2-material/core/overlay/overlay-container'
import {MdGestureConfig} from '@angular2-material/core/gestures/MdGestureConfig'
import {MdIconRegistry} from '@angular2-material/icon/icon-registry'

import {App} from './app/app'
import {APP_ROUTE_PROVIDER} from './app/routes'

bootstrap(App, [
  disableDeprecatedForms(),
  provideForms(),
  APP_ROUTE_PROVIDER,
  provide(OVERLAY_CONTAINER_TOKEN, {useValue: createOverlayContainer()}),
  HTTP_PROVIDERS,
  MdIconRegistry,
  Renderer,
  provide(HAMMER_GESTURE_CONFIG, {useClass: MdGestureConfig})
]).catch(err => console.error(err))

Could not find any breaking change about this in the changelog.

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

Angular version: 2.0.0-rc.4
Angular material version: 2.0.0-alpha.7-2

@jelbourn
Copy link
Member

Ah, this was missed from the changelog. OVERLAY_CONTAINER_TOKEN is gone, there's a new OverlayContainer injectable. If you migrate to NgModule, however, you won't need to provide anything at all for Overlays.

@drager
Copy link
Contributor Author

drager commented Aug 19, 2016

Alright, thanks!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants