ionic-team / ionic-team/ionic-cli

Problem with IonicPageModule.

未關閉
#2,387 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
needs investigation
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

_From @ThunderBirdsX3 on May 15, 2017 4:15_

Reopen from #11550

**Ionic version:** (check one with "x")
[ ] **1.x**
[ ] **2.x**
[x] **3.x**

**I'm submitting a ...** (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

**Current behavior:**
I try to use `PageModule` for navigation to page. `this.navCtrl.push('Page')` or `this.navCtrl.setRoot('Page')`.
That good, Because I didn't to import page in `app.module.ts`. But when i use command `ionic run ios -l -c` and save or reload app. It stuck in old page.

In `app.component.ts` I set `rootPage:any = 'Loading';`. This `loading.ts` has some logic about check database `SQLlite`. After check data it would take to other page `this.navCtrl.setRoot('Login')` or `this.navCtrl.setRoot('Tabs')` with data from database.

And yes, When i save the code or reload app. It will not load `'Loading'` page first. It will go to last page from `navController` and I will not get data from `Loading` page.

**Expected behavior:**
If I use old way. ( Import page to `app.module.ts`) Every thing is fine. After save the code or reload app. It will start with `Loading` page first. Not stuck in last `navController`.

**Steps to reproduce:**

**Related code:**

Good.
```
this.navCtrl.setRoot(Tabs)
this.navCtrl.push(SomePage)
```

Not good.
```
this.navCtrl.setRoot('Tabs')
this.navCtrl.push('SomePage')
```

**Other information:**
```
global packages:

@ionic/cli-utils : 1.0.0
Cordova CLI : 7.0.0
Ionic CLI : 3.0.0

local packages:

@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework : ionic-angular 3.2.0

System:

Node : v6.9.5
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim : 5.0.13

```

_Copied from original issue: ionic-team/ionic#11662_

貢獻指南

開啟貢獻指南

研究方向

先檢查 app.component.ts、loading.ts 和 app.module.ts,然後使用以字串為基礎的導覽範例,透過 ionic run ios -l -c 重現此行為。比較匯入頁面與依名稱參照頁面時的啟動和導覽情況。當重新載入都能一致地從 Loading 開始,並仍能使用預期的資料庫資料導覽至 Login 或 Tabs 時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
ios, node.js, sqlite, typescript
領域
cli, mobile-dev
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。