{"size": 879, "ext": "js", "max_stars_repo_path": "app/ns-ui-widgets-category/repeater/code-behind/code-behind-page.js", "max_stars_repo_name": "yringler/nativescript-sdk-examples-js", "max_stars_repo_stars_event_min_datetime": "2019-12-26T11:48:07.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-26T11:48:09.000Z", "max_issues_repo_path": "app/ns-ui-widgets-category/repeater/code-behind/code-behind-page.js", "max_issues_repo_name": "yringler/nativescript-sdk-examples-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/ns-ui-widgets-category/repeater/code-behind/code-behind-page.js", "max_forks_repo_name": "yringler/nativescript-sdk-examples-js", "max_forks_repo_forks_event_min_datetime": "2019-11-01T11:16:15.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-01T11:16:15.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 38.2173913043, "max_line_length": 98, "alphanum_fraction": 0.7531285552}
const observableArrayModule = require("tns-core-modules/data/observable-array");
const stackLayoutModule = require("tns-core-modules/ui/layouts/stack-layout");
// >> repeater-require
const repeaterModule = require("tns-core-modules/ui/repeater");
// << repeater-require
// >> creating-repeater-code
function onPageLoaded(args) {
    const page = args.object;
    const stackLayoutContainer = page.getViewById("stackLayoutId");
    const secondColorsArray = new observableArrayModule.ObservableArray(["red", "green", "blue"]);

    const repeater = new repeaterModule.Repeater();
    const stackLayout = new stackLayoutModule.StackLayout();
    stackLayout.orientation = "horizontal";
    repeater.itemsLayout = stackLayout;
    repeater.items = secondColorsArray;

    stackLayoutContainer.addChild(repeater);
}

exports.onPageLoaded = onPageLoaded;
// << creating-repeater-code
