Time for action – Setting up the controller

We will set up our controller as computerList.controllers.ComputerListController .

It will have to handle actions on the different view's elements (particularly when the user clicks the add button).

Note that we will create another view after that for each row of the table (it will be a ComputerView).

Therefore, here is our ComputerListController.hx file:

package computerList.controllers; import js.Dom; import js.Lib; import computerList.models.Computer; class ComputerListController { var listBody:js.HtmlDom; var nameField:js.Text; var osField:js.Select; var detailsField:js.Text; var addButton:js.Button; public function new() { listBody = untyped Lib.document.getElementById("listTable").tBodies[0]; nameField ...

Get haXe 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.