-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hi,
I got a question regarding AoT compiling an app using the angular2-redux package. JiT compiling works for my Ionic2 app, but the AoT compiling used for the "ionic build ios" is not working. If I create the AppStore in app.module.ts as in your package example
export const appStoreFactory = createAppStoreFactoryWithOptions({ reducers, additionalMiddlewares: [], debug: true });
providers: [ {provide: AppStore, useFactory: appStoreFactory }]
then JiT compiling works, but AoT compiling throws the following error:
Error: Error encountered resolving symbol values statically. Calling function
'createAppStoreFactoryWithOptions', function calls are not supported. Consider replacing the function or
lambda with a reference to an exported function, resolving symbol appStoreFactory in
/Users/luki/work/kunden/valtech/bmg/mybmg-mobileapp/git/mybmg-mobileapp/.tmp/app/app.module.ts, resolving
symbol AppModule in
If I change the "appStoreFactory" to a function as follows:
export function appStoreFactory () { return createAppStoreFactoryWithOptions({ reducers, additionalMiddlewares: [], debug: true }); }
then the AoT is working (JiT is not working like this) but I get the following error in Xcode Debug when I start the app on my iPhone, that is catched in the catch part of my this.platform.ready() promise:
2016-11-23 19:02:04.933 myBMG[5739:2741555] reject: TypeError: t.appStore.select is not a function. (In 't.appStore.select(c.b)', 't.appStore.select' is undefined)
2016-11-23 19:02:04.937 myBMG[5739:2741555] reject: TypeError: t.appStore.dispatch is not a function. (In 't.appStore.dispatch(t.userActions.alreadyLoggedIn())', 't.appStore.dispatch' is undefined)
Any ideas about using angular2-redux with AoT ?
Thanks a lot for your help!