Hello Ionic 2
Ionic 2 provides a simple starter template to quickly scaffold a simple app. Our app will be called githubIonic, and so we'll quickly scaffold it with the ionic cli.
In your terminal:
$ ionic start githubIonic tutorial --v2
The above command scaffolds an ionic project based on a tutorial template ionic provides. It then downloads the necessary npm packages. We'll build the application using TypeScript, and that's why we have a--ts
flag.
Go to the githubIonic directory withcd githubIonic
. We'll serve the app first, then go through the folder structure. In your terminal, run:
$ ionic serve
You may be asked to select how you would like to serve the ionic app, select_localhost:8100_option. Openhttp://localhost:8100
in your browser, it should looks something similar to this.
Notice that I have opened myChrome Dev Tools, and on the top left part, clicked on the devices Icon so that my app is displayed on a device screen. In this case, the Galaxy S5.
全平台测试
To see the app rendered in all mobile platforms, you can run
$ ionic serve -l
It should open your browser, but if not, visithttp://localhost:8100/ionic-lab
You can play around with the app.