home.component.ts
import { ItemEventData } from "ui/list-view"
import { Component, OnInit } from "@angular/core";
@Component({
selector: "Home",
moduleId: module.id,
templateUrl: "./home.component.html",
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
entries: { currententry: number, totalentry: number}[] = [
{ currententry: 1 , totalentry : 5 },
{ currententry: 2 , totalentry: 5 },
{ currententry: 3 , totalentry: 5 } ];
onItemTap(args: ItemEventData): void {
console.log('Item with index: ' + args.index + ' tapped');
}
constructor() {
}
ngOnInit(): void {
}
}
home.component.html
<ActionBar title="Home" class="action-bar">
</ActionBar>
<ScrollView class="page">
<StackLayout class="home-panel">
<ListView class="list-group" [items]="entries" (itemTap)="onItemTap($event)" style="height:1250px">
<ng-template let-entry="item">
<Label [text]="'Showing ' + entry.currententry + ' to ' + entry.totalentry + ' of ' + entry.totalentry + ' entries' " class="list-group-item-heading" textWrap="true" verticalAlignment="center"
import { ItemEventData } from "ui/list-view"
import { Component, OnInit } from "@angular/core";
@Component({
selector: "Home",
moduleId: module.id,
templateUrl: "./home.component.html",
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
entries: { currententry: number, totalentry: number}[] = [
{ currententry: 1 , totalentry : 5 },
{ currententry: 2 , totalentry: 5 },
{ currententry: 3 , totalentry: 5 } ];
onItemTap(args: ItemEventData): void {
console.log('Item with index: ' + args.index + ' tapped');
}
constructor() {
}
ngOnInit(): void {
}
}
home.component.html
<ActionBar title="Home" class="action-bar">
</ActionBar>
<ScrollView class="page">
<StackLayout class="home-panel">
<ListView class="list-group" [items]="entries" (itemTap)="onItemTap($event)" style="height:1250px">
<ng-template let-entry="item">
<Label [text]="'Showing ' + entry.currententry + ' to ' + entry.totalentry + ' of ' + entry.totalentry + ' entries' " class="list-group-item-heading" textWrap="true" verticalAlignment="center"
style="width: 60%"></Label>
</ng-template>
</ListView>
</StackLayout>
</ScrollView>
</ng-template>
</ListView>
</StackLayout>
</ScrollView>
Comments
Post a Comment