Skip to content

Instantly share code, notes, and snippets.

@anjanawijesundara
Last active August 29, 2015 14:19
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 anjanawijesundara/128e3a71438096f637f5 to your computer and use it in GitHub Desktop.
Save anjanawijesundara/128e3a71438096f637f5 to your computer and use it in GitHub Desktop.
<h2>Edit Customer</h2>
<div class="row" ng-controller='CustomerEditControler'>
<div class="col-md-6">
<form novalidate ng-repeat="customer in CustomerDetail" name="AddNewForm" id="add-new-form" method="post" action="">
<input type="hidden" ng-model="customer.id" value="{{customer.id}}" />
<div class="form-group">
<label>Username</label>
<input class="form-control" type="text" ng-model="customer.Username" value="{{customer.Username}}" required />
</div>
<div class="form-group">
<label>First Name</label>
<input class="form-control" type="text" ng-model="customer.First_Name" value="{{customer.First_Name}}" required />
</div>
<div class="form-group">
<label>Last Name</label>
<input class="form-control" type="text" ng-model="customer.Last_Name" value="{{customer.Last_Name}}" required />
</div>
<div class="form-group">
<label >Email</label>
<input class="form-control" type="text" ng-model="customer.Email" value="{{customer.Email}}" required />
</div>
<div class="form-group">
<label>Status</label>
<input class="form-control" type="text" ng-model="customer.Status" value="{{customer.Status}}" required />
</div>
<button class="btn btn-primary" ng-disabled="AddNewForm.$invalid || isUnchanged(customer)" id="add-new-btn" ng-click="Update_Customer(customer)">Update
<span class="glyphicon glyphicon-floppy-disk"></span></button>
<button class="btn btn-danger" ng-click="Delete_Customer(customer)">Delete <span class="glyphicon glyphicon-trash"></span></button>
<a href="#/" class="btn">Cancel</a>
</form>
</div>
</div>
<h2>Customers</h2>
<div ng-controller="CustomerListControler">
<table class="table table-condensed">
<thead>
<tr>
<th>Username</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Status</th>
<th>Option</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="res in customers | orderBy: 'First_Name'">
<td>{{res.Username}}</td>
<td>{{res.First_Name}}</td>
<td>{{res.Last_Name}}</td>
<td>{{res.Email}}</td>
<td>{{res.Status}}</td>
<td><a href="#/UpdateCustomer/{{res.id}}" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-pencil"></i></button></td>
</tr>
</tbody>
</table>
<a class="btn btn-primary" href="#/NewCustomer">Add New Customer</a>
</div>
<h2>New Customer</h2>
<div class="row" ng-controller="CustomerAddControler">
<div class="col-md-6">
<form name="AddNewForm" id="add-new-form" method="post" action="">
<div class="form-group">
<label for="name">Username</label>
<input class="form-control" type="text" ng-model="customer.Username" required />
</div>
<div class="form-group">
<label for="name">First Name</label>
<input class="form-control" type="text" ng-model="customer.First_Name" required />
</div>
<div class="form-group">
<label for="name">Last Name</label>
<input class="form-control" type="text" ng-model="customer.Last_Name" required />
</div>
<div class="form-group">
<label for="email">Email</label>
<input class="form-control" type="text" ng-model="customer.Email" required />
</div>
<div class="form-group">
<label for="country">Status</label>
<input class="form-control" type="text" ng-model="customer.Status" required />
</div>
<button class="btn btn-primary" ng-disabled="AddNewForm.$invalid || isUnchanged(customer)" id="add-new-btn" ng-click="New_Customer(customer)">Save</button>
<a href="#/" class="btn">Cancel</a>
</form>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment