File tree Expand file tree Collapse file tree
modules/benchmarks/src/js-web-frameworks/ng2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,18 +19,20 @@ export interface RowData {
1919 template : `
2020 <table class="table table-hover table-striped test-data">
2121 <tbody>
22- <tr [class.danger]="item.id === selected" *ngFor="let item of data; trackBy: itemById">
23- <td class="col-md-1">{{ item.id }}</td>
24- <td class="col-md-4">
25- <a href="#" (click)="select(item.id); $event.preventDefault()">{{ item.label }}</a>
26- </td>
27- <td class="col-md-1">
28- <a href="#" (click)="delete(item.id); $event.preventDefault()">
29- <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
30- </a>
31- </td>
32- <td class="col-md-6"></td>
33- </tr>
22+ @for(item of data; track item.id) {
23+ <tr [class.danger]="item.id === selected">
24+ <td class="col-md-1">{{ item.id }}</td>
25+ <td class="col-md-4">
26+ <a href="#" (click)="select(item.id); $event.preventDefault()">{{ item.label }}</a>
27+ </td>
28+ <td class="col-md-1">
29+ <a href="#" (click)="delete(item.id); $event.preventDefault()">
30+ <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
31+ </a>
32+ </td>
33+ <td class="col-md-6"></td>
34+ </tr>
35+ }
3436 </tbody>
3537 </table>
3638 ` ,
@@ -41,10 +43,6 @@ export class JsWebFrameworksComponent {
4143
4244 constructor ( private _appRef : ApplicationRef ) { }
4345
44- itemById ( index : number , item : RowData ) {
45- return item . id ;
46- }
47-
4846 select ( itemId : number ) {
4947 this . selected = itemId ;
5048 this . _appRef . tick ( ) ;
You can’t perform that action at this time.
0 commit comments