Guest User

Untitled

a guest
Jun 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import {Component, OnInit, ChangeDetectionStrategy, Input} from '@angular/core';
  2.  
  3.  
  4. @Component({
  5. selector: "PrincipalEventosListView",
  6. templateUrl: "pages/principal/eventos/eventos.component.html",
  7. changeDetection: ChangeDetectionStrategy.OnPush,
  8. })
  9.  
  10. export class PrincipalEventosComponent {
  11.  
  12. public registros: Array<any>;
  13.  
  14. constructor() {
  15.  
  16. this.registros = [];
  17. this.registros.push({tipo: "Teste 1"});
  18. this.registros.push("String no lugar de objeto.");
  19. this.registros.push({tipo: "Teste 3"});
  20. this.registros.push(123);
  21. this.registros.push({tipo: "Teste 4"});
  22. }
  23.  
  24. }
  25.  
  26. <GridLayout>
  27.  
  28. <ListView [items]="registros">
  29. <template let-item="item">
  30. <Label [text]="item.tipo"></Label>
  31. </template>
  32. </ListView>
  33.  
  34. import { NativeScriptModule } from "nativescript-angular/nativescript.module";
  35.  
  36. import { NativeScriptUIListViewModule } from "nativescript-ui-listview/angular";
  37.  
  38. import { NativeScriptModule } from "nativescript-angular/nativescript.module";
  39.  
  40. @NgModule({
  41. ...
  42. imports: [NativeScriptModule],
  43. ...
  44. })
Add Comment
Please, Sign In to add comment