官术网_书友最值得收藏!

Creating a HelloWorld app via Ionic Creator

Another way to start your app codebase is to use Ionic Creator. This is a great interface builder to accelerate your app development with a drag-and-drop style. You can quickly take existing components and position them to visualize how it should look in the app via a web-based interface. Most common components like buttons, images, checkboxes, and so on are available.

Ionic Creator allows the user to export everything as a project with all .html, .css, and .js files. You should be able edit content in the /www folder to build on top of the interface.

Getting ready

Ionic Creator requires registration for a free account at https://creator.ionic.io/ to get started.

How to do it…

Create a new project called myApp:

How to do it…

You will see this simple screen:

How to do it…

The center area is your app interface. The left side gives you a list of pages. Each page is a single route. You also have access to a number of UI components that you would normally have to code by hand in an HTML file. The right panel shows the properties of any selected component.

You're free to do whatever you need to do here by dropping components to the center screen. If you need to create a new page, you have to click the plus sign in the Pages panel. Each page is represented as a link, which is basically a route in AngularJS UI Router's definition. To navigate to another page (for example, after clicking a button), you can just change the Link property and point to that page.

There is an Edit button on top where you can toggle back and forth between Edit Mode and Preview Mode. It's very useful to see how your app will look and behave.

Once completed, click on the Export button on the top navigation. You have three options:

  • Use the Ionic CLI tool to get the code
  • Download the project as a zip file
  • Review the raw HTML
How to do it…

The best way to learn Ionic Creator is to play with it. You can add a new page and pick out any existing templates. This example shows a Login page template:

How to do it…

Here is how it should look out of the box:

How to do it…

There's more...

To switch to Preview Mode where you can see the UI in a device simulator, click the switch button on the top right to enable Test:

There's more...

In this mode, you should be able to interact with the components in the web browser as if it's actually deployed on the device.

If you break something, it's very simple to start a new project. It's a great tool to use for "prototyping" and to get initial template or project scaffolding. You should continue to code in your regular IDE for the rest of the app. Ionic Creator doesn't do everything for you, yet. For example, if you want to access specific Cordova plugin features, you have to write that code separately.

Also, if you want to tweak the interface outside of what is allowed within Ionic Creator, it will also require specific modifications to the .html and .css files.

主站蜘蛛池模板: 应用必备| 卓尼县| 安图县| 山丹县| 宝清县| 奈曼旗| 房山区| 芦溪县| 长汀县| 霞浦县| 忻州市| 青岛市| 厦门市| 海兴县| 平定县| 密云县| 遵义县| 淄博市| 卢龙县| 板桥市| 临清市| 徐州市| 木里| 芒康县| 常德市| 平遥县| 石门县| 长白| 平顶山市| 辽源市| 民丰县| 平阳县| 沙雅县| 固阳县| 荣成市| 虎林市| 绍兴县| 夏津县| 宁陵县| 封开县| 大埔区|