JSFiddle - React, Tailwind, and code Playground

by Felipe Miosso

HTML

<div ng-app>
    <div id="content" ng-controller="NameController">
        <input type="text" ng-model="value" />
        <button ng-click="addName()">add item</button>
        <h2>Items</h2>
        <form action="/" method="post">
            <!-- loaded by razor:  -->
            <input ng-repeat="name in names" type="text" name="names[{{$index}}].NameID" value="{{name}}" />
            
            <input type="submit" value="save" />
        </form>
    </div>
</div>

CSS

form > input { clear:both; display:block; }

JavaScript

function NameController($scope) {
        $scope.names = [];
        $scope.addName = function () {
            $scope.names.push($scope.value);
        }
    }