H5分享系列一----ionic/Angular框架概覽

參考文檔/資源

分享大綱

ionic 技術(shù)架構(gòu)

ionic技術(shù)架構(gòu)

ionic 安裝

Requirement
  • Node.js 6
  • xCode非必需,只在運(yùn)行iOS模擬器時(shí)需要
  • Android SDK/JDK非必需,只在運(yùn)行Android模擬器時(shí)需要
安裝
$ npm install -g ionic cordova
創(chuàng)建ionic項(xiàng)目
// 創(chuàng)建一個(gè)項(xiàng)目,名稱為:cutePuppyPics;--v2表示使用ionic2;默認(rèn)會(huì)以`tutorial`為模板來創(chuàng)建項(xiàng)目,可修改。
$ ionic start cutePuppyPics --v2

tutorial項(xiàng)目分析

開發(fā)工具的選擇
瀏覽器調(diào)試
// -c表示打印客戶端日志,-s表示打印服務(wù)端日志。
$ ionic serve -c -s
項(xiàng)目的文件結(jié)構(gòu)
├── node_modules                               # 第三方庫(kù)
├── platforms                                  # android/ios工程目錄
│   ├── android
│   └── ios
├── plugins                                    # native插件
│   ├── cordova-plugin-console
│   ├── cordova-plugin-device
│   ├── cordova-plugin-splashscreen
│   ├── cordova-plugin-statusbar
│   ├── cordova-plugin-whitelist
│   └── ionic-plugin-keyboard
├── resources                                 # android/ios資源文件,如:app icon, 啟動(dòng)頁(yè)面
│   ├── android
│   └── ios
├── src                                       # 業(yè)務(wù)邏輯代碼目錄,大部分時(shí)間我們都跟它打交道
│   ├── app                                   # App級(jí)別代碼目錄
│   ├── assets                                # 資源文件目錄,如:圖片/字體
│   ├── pages                                 # 頁(yè)面存放目錄
│   └── theme                                 # 公共樣式
└── www                                       # typescript編譯后的目錄,可直接放到web服務(wù)器上
    ├── assets
    └── build
命名規(guī)范

詳見Angular命名約定

App的入口
main.dev.ts -> app.module.ts -> app.component.ts
page跳轉(zhuǎn)
iOS模擬器調(diào)試
$ ionic emulate ios

QA

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容