Skip to content

Commit

Permalink
Initializing a new product
Browse files Browse the repository at this point in the history
  • Loading branch information
sartak committed Feb 27, 2013
1 parent 0b5858a commit 4dd20c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/002-templates/controller.ts
Expand Up @@ -4,6 +4,7 @@
/// <reference path="../../lib/Oryx.ts" />

class OrderController {
public current_product : Product;
public order : Order;
public view;
public table;
Expand Down Expand Up @@ -41,6 +42,17 @@ class OrderController {

this.table = this.initialize_table();
this.view = this.initialize_view();

this.initialize_new_product();
}

initialize_new_product () {
this.current_product = new Product (null, {
sku: "",
description: "",
quantity: 0,
});
this.view.set_data_source( this.current_product );
}

renderer_for (prop : string) {
Expand Down

0 comments on commit 4dd20c0

Please sign in to comment.