angular-material-extensions / google-maps-autocomplete

Autocomplete input component and directive for google-maps built with angular and material design |
https://angular-material-extensions.github.io/google-maps-autocomplete
MIT License
169 stars 60 forks source link

Module importing error #253

Closed quedicesebas closed 4 years ago

quedicesebas commented 4 years ago

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions

3.2.1

Repro steps

Install and import like docs says:

import { AgmCoreModule } from '@agm/core';
import { MatGoogleMapsAutocompleteModule } from '@angular-material-extensions/google-maps-autocomplete';
@NgModule({
  declarations: [AppComponent, ...],
  imports: [
     // important !!!
     AgmCoreModule.forRoot({
          apiKey: 'YOUR_KEY',
          libraries: ['places']
        }),
     MatGoogleMapsAutocompleteModule.forRoot(), ...],  
  bootstrap: [AppComponent]
})
export class AppModule {
}

The log given by the failure

Property 'forRoot' does not exist on type 'typeof MatGoogleMapsAutocompleteModule'.

Mention any other details that might be useful

AnthonyNahas commented 4 years ago

which version are u using ?

ghost commented 4 years ago

Hi, I'm getting the same error on version 4.0.1.

error TS2339: Property 'forRoot' does not exist on type 'typeof MatGoogleMapsAutocompleteModule'.

26     MatGoogleMapsAutocompleteModule.forRoot(),
zacuke commented 4 years ago

Try removing .forRoot() - it seems the documentation is a bit outdated.

AnthonyNahas commented 4 years ago

yes! ForRoot does not exists anymore! I've just updated the readme! thank you!