Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Lazy loading from common folder #1520

Open
stephaneHillerCGI opened this issue Mar 8, 2019 · 0 comments
Open

Lazy loading from common folder #1520

stephaneHillerCGI opened this issue Mar 8, 2019 · 0 comments

Comments

@stephaneHillerCGI
Copy link

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request

Current behavior:

I have a repo with three folder : 2 ionic apps and a common module. The goal of this common module is to provide common information for the two ionic projects (the module contains providers, component, models, pages, ...).

But when you try to lazy load a page from the module, it doesn't work ("core.js:1350 ERROR Error: Uncaught (in promise): invalid link: MyPage").

ps: my current ionic version is 4.11, but it's an Ionic v3 application.

Expected behavior:

The expected behaviour would be a working lazy loading.

Steps to reproduce:

https://github.com/stephaneHillerCGI/ionicCommonModule

Clone github repo and run npm install on each of the three folder. After that you can run ionic serve from both folder ionicProjectA and ionicProjectB.

The two pages that will be displayed will be the same (a button "My component" and a button "Launch"). Press "Launch" to navigate to another page. In project A it doesn't work (because of live reload) and in project B, it works (no live reload). To switch from live reload to no live reload, just comment/uncomment the lines in (my-page.module.ts, my-page.ts and my-module.module.ts).

Related code:

The code of the application can be clone from : https://github.com/stephaneHillerCGI/ionicCommonModule

Other information:

Is it possible that Ionic doesn't "see" the IonicPage() annotation because this annotation isn't in the src folder ? If true, is it possible to extends the watcher to another folder so Ionic can recognize the annotation ?

   ionic (Ionic CLI)  : 4.11.0 (C:\Users\stephane.hiller\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.0

System:

   NodeJS : v8.9.4 (C:\Program Files\nodejs\node.exe)
   npm    : 5.6.0
   OS     : Windows 7
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

1 participant