{"size": 1257, "ext": "js", "max_stars_repo_path": "dist/knockout/bridge/KnockoutDemo.js", "max_stars_repo_name": "Chelton17/idk", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/knockout/bridge/KnockoutDemo.js", "max_issues_repo_name": "Chelton17/idk", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/knockout/bridge/KnockoutDemo.js", "max_forks_repo_name": "Chelton17/idk", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.0789473684, "max_line_length": 171, "alphanum_fraction": 0.5441527446}
/**
 * @version 1.0.0.0
 * @copyright Copyright ©  2017
 * @compiler Bridge.NET 16.7.1
 */
Bridge.assembly("KnockoutDemo", function ($asm, globals) {
    "use strict";

    Bridge.define("KnockoutDemo.App", {
        main: function Main () {
            // Original "Hello wold" demo can be found here:
            // http://knockoutjs.com/examples/helloWorld.html

            ko.applyBindings(new KnockoutDemo.ViewModel("Planet", "Earth")); // This makes Knockout get to work
        }
    });

    Bridge.define("KnockoutDemo.ViewModel", {
        props: {
            firstName: null,
            lastName: null,
            fullName: null
        },
        ctors: {
            ctor: function (first, last) {
                this.$initialize();
                this.firstName = ko.observable(first);
                this.lastName = ko.observable(last);

                // Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName.
                this.fullName = ko.pureComputed(Bridge.fn.bind(this, function () {
                    return (this.firstName() || "") + " " + (this.lastName() || "");
                }));
            }
        }
    });
});
