## Package Requirements
Make sure you have the required packages installed:
```
iron:router
fourseven:scss
meteoric:ionic-sass
meteoric:ionicons-sass
meteoric:ionic
```
## Blaze Templates
`meteor-ionic` makes extensive use of Blaze Templates. There are two ways to include a Blaze Template into your page: inclusion syntax and block syntax.
### Inclusion Syntax
Most Meteor developers are already familiar with the inclusion syntax which takes a template like this:
```
Meteor + Ionic = Meteoric
{{/myPanel}} ``` And could then output: ```Meteor + Ionic = Meteoric
Your content here
{{/ionContent}} ``` Which will output: ```Your content here
Your content here
{{/ionContent}} ``` Which would output: ```Your content here
{{subTitle}}
{{/each}} {{/ionList}} {{/ionContent}} ``` ### ionItem To get a nice Ionic styled list item wrap your content in a `ionItem` block template. `ionItem` can be a list, form, links, etc. It is a very flexible component. I would suggest taking some time to discover all it can do. Below are some examples. #### Avatar/Icon/Button Example ``` {{#ionList class="my-class"}} {{#each times}} {{#ionItem buttonRight=true avatar=true}}(555) 555-1212
{{/ionItem}} {{/each}} {{/ionList}} ``` #### Path and Link Examples Meteor uses Iron:Router. Most are familiar with Iron:Router's [pathFor](https://github.com/EventedMind/iron-router/blob/devel/Guide.md#pathfor) and [urlFor](https://github.com/EventedMind/iron-router/blob/devel/Guide.md#urlfor) helpers. Meteoric lets you tap into those helpers from within `ionItem` or ignore them, the choice is yours. To call IR's `pathFor` you would specify your route in the `path` attribute. ``` {{#ionItem path="item.detail" _id:"" data="" query="" hash="" class=""}}...{{/ionItem}} ``` To call IR's `urlFor` you would specify your route in the `url` attribute. ``` {{#ionItem url="item.detail" _id:"" data="" query="" hash="" class=""}}...{{/ionItem}} ``` And if you want to specify a path without calling any IR helpers specify your route in the `path` or `route` attribute and make sure not to include any of these attributes `data` `query` `hash` . ``` {{#ionItem route="item.detail" _id:"" class=""}}...{{/ionItem}} ``` Lastly you can also pass a raw url by including the `href` attribute. ``` {{#ionItem href="https://google.com" class=""}}...{{/ionItem}} ``` ##### Here are some examples for context **Raw url** ``` {{! href="https://google.com" }} {{#ionList}} {{#each item}} {{#ionItem href="https://google.com" iconRight=true}}{{subTitle}}
{{> ionIcon icon="ios-arrow-right" }} {{/ionItem}} {{/each}} {{/ionList}} ``` **Passed route from parent (no IR helper)** ``` {{! href="/products/zcZmWRjJztydnCJer" }} {{#ionList}} {{#each products}} {{#with product}} {{#ionItem product=this route="products.show" iconLeft=true iconRight=true}} {{> _voteButton}}{{tagline}}
{{numberOfComments}} {{> ionIcon icon="ios-chatbubble" }} {{/ionItem}} {{/with}} {{/each}} {{/ionList}} ``` **IronRouter's pathFor href** ``` {{! href="/item/details/jkh34k234h?parentId=hkjh45j43k3#reviews" }} {{#ionList}} {{#each item}} {{#ionItem path='item.detail' _id:this._id query=itemQuery hash="reviews" iconRight=true}}{{subTitle}}
{{> ionIcon icon="ios-arrow-right" }} {{/ionItem}} {{/each}} {{/ionList}} ``` **IronRouter's urlFor href** ``` {{! href="http://www.example.com/item/details?parentId=hkjh45j43k3" }} {{#ionList}} {{#each item}} {{#ionItem url='item.detail' query=itemQuery iconRight=true}}{{subTitle}}
{{> ionIcon icon="ios-arrow-right" }} {{/ionItem}} {{/each}} {{/ionList}} ``` ## Modals The `ionModal` component is quite easy to implement. First, create a template for your modal: ``` {{#ionModal title="My Modal"}}My modal content goes here
{{/ionModal}} ``` Then attach it to a `button` or `a` element by passing in the name of the template to the `data-ion-modal` attribute. ``` ```