JSFiddle - React, Tailwind, and code Playground

by Ravindra Athreya

HTML

<div ng-app>
    <div ng-controller="MyCtrl">
        <table>
            <tr ng-repeat="company in companies">
                <td>
                    <input type="radio" ng-model="userChoice.companyId" name="companyId" value="{{company.id}}" />{{company.name}}
                </td>
            </tr>
        </table>
        <br>
        <br>
        <br>CompanyId is: {{userChoice.companyId}}
        <br>
        <br>
        <button ng-disabled="!userChoice.companyId">Continue</button>
    </div>
</div>

JavaScript

function MyCtrl($scope) {

    $scope.companies = [{
        "id": 4,
        "name": "Facebook"
    }, {
        "id": 3,
        "name": "Twitter"
    }, {
        "id": 2,
        "name": "Google"
    }, {
        "id": 1,
        "name": "Apple"
    }]
    
    $scope.userChoice = {};

}