Skip to content

Instantly share code, notes, and snippets.

@mhartington
Created February 23, 2016 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhartington/02abcfd3f30d6eef9737 to your computer and use it in GitHub Desktop.
Save mhartington/02abcfd3f30d6eef9737 to your computer and use it in GitHub Desktop.
import {Page} from 'ionic-framework/ionic';
@Page({
template: `
<ion-navbar *navbar>
<ion-title>
Home
</ion-title>
</ion-navbar>
<ion-content class="home">
<ion-list>
<ion-item-group *ngFor="#key of keys()">
<ion-item-divider light>
{{key}}
</ion-item-divider>
<ion-item *ngFor="#obj of data[key]">
<pre>{{obj.first_name }}</pre>
</ion-item>
</ion-item-group>
</ion-list>
</ion-content>
`,
})
export class HomePage {
data = {
"A": [
{
"first_name": "Albert"
}
],
"B": [
{
"first_name": "Ben"
}
]
}
constructor() { }
keys() {
return Object.keys(this.data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment