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