JSFiddle - React, Tailwind, and code Playground

by daylight

HTML

<div ng-app="" data-ng-controller="rowController">
    <div id="mainContent" class="row">
        <button ng-click="addSimpleItem()">Add Item</button>
        <div id="simpleItems">
             <h3>Line Items</h3>
            <form>
                <table>
                    <thead>
                        <tr>
                            <th>select</th>
                            <th>Item ID</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="l in allItems">
                            <td>
                                <input type="checkbox" 
                                ng-init="itemId ={{l.id.toString()}}" ng-click="checkBoxClicked(itemId)" />
                            </td>
                            <td>
                                <input class="form-control" type="text" value="{{l.id}}" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</div>

JavaScript

function rowController($scope) 
{

    function simpleItem(id) {
        this.id = id;
    }

    function addRow() {
        var currentItem = new simpleItem("a");
        currentItem.id = getRandom(100000).toString() + "X" + getRandomLetters(5).toUpperCase();

        $scope.allItems.splice(0, 0, currentItem);

    }

    function getRandom(y) {
        // returns value between 1 and y (inclusive)
        return Math.ceil(Math.random() * y);
    }

    function getRandomLetters(numberOfLetters) {

        var outString = '';
        for (y = 0; y < numberOfLetters; y++) {
            outString += String.fromCharCode(97 + getRandom(25));
        }
        return outString;
    }

    function addSimpleItem() {
        addRow();

    }

    function checkBoxClicked(selectedItem) {
            alert(selectedItem);
    }

    $scope.allItems = [];
    $scope.addSimpleItem = addSimpleItem;
    $scope.checkBoxClicked = checkBoxClicked;
}