Ionic Framework Hello World App

完成所有设置后,制作 Hello World App

  • 要创建简单空白应用程序,请在终端上运行以下命令:
ionic start HelloWorld blank  // create new project

cd HelloWorld                 // get into HelloWorld directory
  • 在 subline / webstrome IDE 中打开 HelloWorld 项目:
    • 在 www / ditectory 中编辑 index.html
 <body ng-app="starter">
   <ion-pane>
     <ion-header-bar class="bar-stable">
       <h1 class="title">Ionic Hello World App</h1>
     </ion-header-bar>
     <ion-content>
        <div class="center">Hello World..!</div>
     </ion-content>
    </ion-pane>
 </body>
  • 要从终端在浏览器中运行:
ionic serve                  // run the app in browser
  • 要添加平台:
ionic platform add android   // add android platform
ionic platform add ios       // add ios platform
  • 要在设备上运行:
adb devices                  // to check devices is connected
ionic run android            // to run on android devices
ionic run ios                // to run on ios devices
  • 要在 livereload 中运行:
ionic run android -c -s -l    // to check app in live reload with console.