mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
test: add repeater example
This commit is contained in:
committed by
Martin Yankov
parent
e66a6fa286
commit
20c4417412
10
e2e/safe-area/app/repeater/repeater-page.ts
Normal file
10
e2e/safe-area/app/repeater/repeater-page.ts
Normal 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;
|
||||||
|
}
|
||||||
3
e2e/safe-area/app/repeater/repeater-page.xml
Normal file
3
e2e/safe-area/app/repeater/repeater-page.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<Page xmlns="http://www.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo">
|
||||||
|
<Repeater items="{{ myItems }}" backgroundColor="Pink" />
|
||||||
|
</Page>
|
||||||
Reference in New Issue
Block a user