JSFiddle - React, Tailwind, and code Playground
by shubh0602
HTML
<div ng-app="" ng-controller="ContactController">
Email:<input type="text" ng-model="newcontact" />
<button ng-click="add()">Add</button>
<h2>Contacts</h2>
<ul>
<li ng-repeat="contact in contacts"> {{ contact }} </li>
</ul>
</div>
JavaScript
function ContactController($scope) {
$scope.contacts = ["[email protected]", "[email protected]"];
$scope.add = function() {
$scope.contacts.push($scope.newcontact);
$scope.newcontact = "";
}
}