test: add repeater example

This commit is contained in:
Vasil Chimev
2018-08-22 16:52:31 +03:00
committed by Martin Yankov
parent e66a6fa286
commit 20c4417412
2 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import { Observable } from "tns-core-modules/data/observable";
const colors = ["red", "green", "blue", "yellow"];
export function onNavigatingTo(args) {
const page = args.object;
const vm = new Observable();
vm.set("myItems", colors);
page.bindingContext = vm;
}

View File

@@ -0,0 +1,3 @@
<Page xmlns="http://www.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo">
<Repeater items="{{ myItems }}" backgroundColor="Pink" />
</Page>