@mburger81 wrote:
Hi, we are using from the beginning
LazyLoading
and the newIoniPage
decorator in our app. Now we think we have discovered a new bug or something we simple don’t understand.Our
app.module.ts
is something like that:... @NgModule({ declarations: [ MyApp ], imports: [ BrowserModule, HttpModule, IonicModule.forRoot(MyApp, { preloadModules: true }) ], bootstrap: [ IonicApp ], entryComponents: [ MyApp ], ....
our app.component.ts is something like that
@Component({ templateUrl: 'app.html' }) export class MyApp { rootPage: string; constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) { this.initializeApp(); } initializeApp() { this.platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. this.statusBar.styleDefault(); this.splashScreen.hide(); // this.rootPage = 'MainPage'; }); } }
as you can see the
MainPage
would not be loaded it is commented, so at startup we would have a blank page and the constructor ofMainPage
is not loaded. Now we uncommentthis.rootPage = 'MainPage';
and live reload does reload the page, and now theMainPage
is shown, but the problem is the constructor is called twice time.
Next step we do, we re comment thethis.rootPage = 'MainPage';
the page does a reload and page is still loaded and the constructor is loaded one time. So this is a very strange thing!some ideas?
cli packages: (/usr/lib/node_modules) @ionic/cli-utils : 1.9.2 ionic (Ionic CLI) : 3.9.2 global packages: Cordova CLI : 7.0.1 local packages: @ionic/app-scripts : 2.1.4 Cordova Platforms : android 6.2.3 Ionic Framework : ionic-angular 3.6.0 System: Android SDK Tools : 26.0.2 Node : v6.11.2 npm : 5.3.0 OS : Linux 4.10
Posts: 1
Participants: 1