Skip to content

Commit 8946fb2

Browse files
committed
refactor: migrate template => ng-template
1 parent ecc5aec commit 8946fb2

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

app/listView/asyncPipeTemplate/async-pipe-template.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export class DataItem {
1010
template: `
1111
<GridLayout rows='*,60' automationText="mainView">
1212
<ListView [items]="myItems | async">
13-
<template let-item="item" let-i="index" let-odd="odd" let-even="even">
13+
<ng-template let-item="item" let-i="index" let-odd="odd" let-even="even">
1414
<StackLayout [class.odd]="odd" [class.even]="even">
1515
<Label [text]='"index: " + item.name'></Label>
1616
</StackLayout>
17-
</template>
17+
</ng-template>
1818
</ListView>
1919
<TextView row='1' [text]='output' automationText="tvResult" textWrap="true"></TextView>
2020
</GridLayout>
@@ -52,4 +52,4 @@ export class ListViewAsyncPipeComponent {
5252
clearInterval(intervalId);
5353
}, 5000);
5454
}
55-
}
55+
}

app/listView/commonTemplate/list-view-page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
66
template: `
77
<StackLayout automationText="mainView">
88
<ListView [items]="myItems" (itemTap)="onItemTap($event)">
9-
<template let-item="item" let-i="index" let-odd="odd" let-even="even">
9+
<ng-template let-item="item" let-i="index" let-odd="odd" let-even="even">
1010
<StackLayout [class.odd]="odd" [class.even]="even">
1111
<Label [text]='"index: " + i'></Label>
1212
<Label [text]='"[" + item.id +"] " + item.name'></Label>
1313
</StackLayout>
14-
</template>
14+
</ng-template>
1515
</ListView>
1616
<TextView [text]="results" automationText="tvResults" textWrap="true"></TextView>
1717
</StackLayout>
@@ -42,4 +42,4 @@ export class ListViewComponent {
4242

4343
class DataItem {
4444
constructor(public id: number, public name: string) { }
45-
}
45+
}

app/listView/customTemplate/list-view-item-template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export class CustomTemplate {
1818
template: `
1919
<GridLayout rows="*" automationText="mainView">
2020
<ListView [items]="myItems">
21-
<template let-item="item">
21+
<ng-template let-item="item">
2222
<custom-template [data]="item"></custom-template>
23-
</template>
23+
</ng-template>
2424
</ListView>
2525
</GridLayout>
2626
`,

app/listView/nestedTemplate/list-view-nested-template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';
55
template: `
66
<GridLayout rows="* auto" automationText="mainView">
77
<ListView [items]="myItems">
8-
<template let-item="item">
8+
<ng-template let-item="item">
99
<GridLayout>
1010
<Label [text]="'Item ' + item"></Label>
1111
<Label *ngIf="item === 'error'" text="ERROR"></Label>
1212
</GridLayout>
13-
</template>
13+
</ng-template>
1414
</ListView>
1515
1616
<Button text="navigate" row="1" [nsRouterLink]="['/first']"></Button>

0 commit comments

Comments
 (0)