2017-04-08 19 views
0

我正在從事Ionic 2項目。我目前安裝的版本如下圖所示。它是離子2的穩定版本嗎?如果不是,那麼我應該更新哪個組件版本?如何更新穩定版本的離子2

Your system information: 

Cordova CLI: 6.2.0 
Ionic Framework Version: 2.3.0 
Ionic CLI Version: 2.2.2 
Ionic App Lib Version: 2.2.1 
Ionic App Scripts Version: 1.1.4 
ios-deploy version: 1.9.1 
ios-sim version: Not installed 
OS: OS X El Capitan 
Node Version: v7.7.0 
Xcode version: Xcode 8.1 Build version 8B62 

這裏我package.json

"dependencies": { 
    "@angular/common": "2.4.8", 
    "@angular/compiler": "2.4.8", 
    "@angular/compiler-cli": "2.4.8", 
    "@angular/core": "2.4.8", 
    "@angular/forms": "2.4.8", 
    "@angular/http": "2.4.8", 
    "@angular/platform-browser": "2.4.8", 
    "@angular/platform-browser-dynamic": "2.4.8", 
    "@angular/platform-server": "2.4.8", 
    "@ionic-native/core": "^3.1.0", 
    "@ionic-native/geolocation": "^3.4.4", 
    "@ionic-native/launch-navigator": "^3.4.4", 
    "@ionic-native/splash-screen": "3.1.0", 
    "@ionic-native/status-bar": "3.1.0", 
    "@ionic/storage": "2.0.0", 
    "font-awesome": "^4.7.0", 
    "ionic-angular": "2.3.0", 
    "ionic2-rating": "^1.2.0", 
    "ionicons": "3.0.0", 
    "rxjs": "5.0.1", 
    "sw-toolbox": "3.4.0", 
    "zone.js": "0.7.2" 
    }, 
    "devDependencies": { 
    "@ionic/app-scripts": "1.1.4", 
    "typescript": "2.0.9" 
    }, 

console OOF谷歌CHROM其顯示lang.js:130 Angular is running in the development mode. Call enableProdMode() to enable the production mode.如何更新到Angular2

回答

1

你可以在github上的changelog找到顯式的Ionic更新指令。

您的安裝版本很穩定,但還有更高版本。因此,您可以觀察更改並決定是否需要它們並進行更新。

您可以在Angular中啓用生產模式,方法是從其核心導入相同的名稱函數並在引導之前調用它。

import { enableProdMode } from '@angular/core' 

enableProdMode() 
bootstrap() 
+0

我應該把它寫在'app.module.ts'文件中嗎? –

+0

取決於您是否有'bootstrap()'調用。最有可能的是,您的應用程序源中只有一個'bootstrap()'。所以你可以在它之前找到它並調用'enableProdMode()'。 –