JSFiddle - React, Tailwind, and code Playground

by bateast

HTML

<body ng-app ng-controller="ctrl">
    Customer name :<br />
    <input type="text" ng-model="newCustomer.name" />
    <br/>
    Customer city :<br />
    <input type="text" ng-model="newCustomer.city" />
    <button ng-click="addCustomer()">Add customer</button>

    <div>customers: {{customers}}</div>
</body>

JavaScript

function ctrl($scope){
    $scope.customers=[{name:'bob',city:'delhi'},{name:'david',city:'bombay'}];
    $scope.addCustomer = function() {    
        $scope.customers.push({name:$scope.newCustomer.name,city:$scope.newCustomer.city});
    }
}