Skip to content

Instantly share code, notes, and snippets.

@hquach
Created November 9, 2018 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hquach/99dc76a64639fffed7026343dd311c6b to your computer and use it in GitHub Desktop.
Save hquach/99dc76a64639fffed7026343dd311c6b to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<title>AngularJS, PHP, MySQL</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div ng-app='myapp' ng-controller="userCtrl">
<!-- New entry -->
<table>
<tr>
<td>First Name</td>
<td><input type='text' id='txt_fname' ng-model='fname'></td>
</tr>
<tr>
<td>Last Name</td>
<td><input type='text' id='txt_lname' ng-model='lname'></td>
</tr>
<tr>
<td>Username</td>
<td><input type='text' id='txt_username' ng-model='username'></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type='button' id='but_save' value='Save' ng-click="add()" ></td>
</tr>
</table>
<!-- User list -->
<table border="1">
<tr>
<th>First name</th>
<th>Last name</th>
<th>Username</th>
<th>&nbsp;</th>
</tr>
<tr ng-repeat="user in users">
<td>{{user.fname}}</td>
<td>{{user.lname}}</td>
<td>{{user.username}}</td>
<td><input type='button' ng-click='remove($index,user.id);' value='Delete'></td>
</tr>
</table>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment