JSFiddle - React, Tailwind, and code Playground

by Shanid

HTML

<div ng-app="angularjs-starter" ng-controller="MainCtrl">
        
    <fieldset  data-ng-repeat="choice in choices">
        <select>
            <option>Mobile</option>
            <option>Office</option>
            <option>Home</option>
        </select>
        <input type="text" ng-model="choice.name" name="" placeholder="Enter mobile number">
        <button ng-show="$last" ng-click="addNewChoice()">+</button>
        <button ng-show="$last" ng-click="removeChoice()">-</button>
    </fieldset>

    <div id="choicesDisplay">
      {{ choices }}
    </div>
        
</div>

JavaScript

var app = angular.module('angularjs-starter', []);

app.controller('MainCtrl', function($scope) {

  $scope.choices = [{id: 'choice1'}, {id: 'choice2'}];
  
  $scope.addNewChoice = function() {
    var newItemNo = $scope.choices.length+1;
    $scope.choices.push({'id':'choice'+newItemNo});
  };
    
  $scope.removeChoice = function() {
    var removeItem = $scope.choices.length-1;
    
  };
  
  $scope.showChoiceLabel = function (choice) {
    return choice.id === $scope.choices[0].id;
  }
  
});