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

Ionic v2 AgmCoreModule import #686

Closed
juanludlf opened this issue Sep 29, 2016 · 7 comments
Closed

Ionic v2 AgmCoreModule import #686

juanludlf opened this issue Sep 29, 2016 · 7 comments
Assignees
Milestone

Comments

@juanludlf
Copy link

Issue description

I'm working on an Ionic v2 project. The import statement presented in Getting started guide does not work.

Possible solution

I think it should be: import {AgmCoreModule} from 'angular2-google-maps/ts/core';
Instead of: import {AgmCoreModule} from 'angular2-google-maps/core';

angular2 & angular2-google-maps version

"angular2-google-maps": "^0.15.0"
"ionic-angular": "^2.0.0-rc.0"
@modularcoder
Copy link

@Juanlu91 have you managed to launch angular2-google-maps in ionic?

I'm stuck trying to getting started. Maybe you could help

I'm importing AgmCoreModule this way

import { AgmCoreModule } from 'angular2-google-maps/ts/core';

And I'm trying to add AgmCoreModule in imports

  imports: [
    IonicModule.forRoot(MyApp),
    AgmCoreModule.forRoot({
      apiKey: 'MY_API_KEY'
    })
  ],

Here is my full ngModule definition

@NgModule({
  declarations: [
    MyApp,
    Map,
    Activities,
    Submit,
    Settings,
    Login,
    Page1,
    Page2
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    AgmCoreModule.forRoot({
      apiKey: 'AIzaSyCiF08n8AVLZqchOD7uoKZ43fqc-19oS0k'
    })
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    Map,
    Activities,
    Submit,
    Settings,
    Login,
    Page1,
    Page2
  ],
  providers: []
})

And I'm getting this error when trying to build

ngc error: Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in E:/node/hotby.me/hotby-ionic/.tmp/app/app.module.ts, resolving symbol AppModule in E:/node/hotby.me/hotby-ionic/.tmp/app/app.module.ts

@napsio
Copy link

napsio commented Oct 5, 2016

I get the same error if I try to build angular2-google-maps in an ionic app. Changing the import statement does not change anything. The error is the same.

Any solution for that?

@eusthace811
Copy link

Ohh, I have the same issue. Any help?

@juanludlf
Copy link
Author

Sorry guys, the only way I found to get it to work was to add '--dev' flag to the build task in package.json as described here:

"scripts": {
    "build": "ionic-app-scripts build --dev",

However, this produces very slow apps. So fow now, I'll use plain google-maps javascript v3 until the AOT compilation works again.
I closed this issue because it's a duplicate of #629.
Good luck! I wish we could have angular2-google-maps working soon.

@sebholstein
Copy link
Owner

This will be fixed with #709.
Related blog post: http://stevemichelotti.com/integrate-angular-2-google-maps-into-ionic-2/

@sebholstein sebholstein reopened this Oct 21, 2016
@sebholstein sebholstein added this to the 0.16.0 milestone Oct 21, 2016
@sebholstein sebholstein self-assigned this Oct 21, 2016
@juanludlf
Copy link
Author

Great job @SebastianM! Thank you

@basvdijk
Copy link

I've upgraded to Ionic2 RC4 and Ionic app scripts 0.47 and the error started occurring again:

Error encountered resolving symbol values statically. Function calls are not supported.
            Consider replacing the function or lambda with a reference to an exported function, resolving symbol

Perhaps the package is not up to date anymore with the latest ngc? or with an incorrect version of metadata.json?

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

No branches or pull requests

6 participants