Added delete function to controllers.js and changed delete button style
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
<table id="choose-address-table" class="ui-widget ui-widget-content">
|
||||
<thead>
|
||||
<tr ng-repeat="ui-widget-header">
|
||||
<th>ID</th>
|
||||
<th>Etunimi</th>
|
||||
<th>Sukunimi</th>
|
||||
<th>Sähköposti</th>
|
||||
@@ -17,7 +16,6 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="x in members">
|
||||
<td>{{ x.id }}</td>
|
||||
<td>{{ x.first_name }}</td>
|
||||
<td>{{ x.last_name }}</td>
|
||||
<td>{{ x.email }}</td>
|
||||
@@ -25,7 +23,7 @@
|
||||
<td>{{ x.jas }}</td>
|
||||
<td>{{ x.POR }}</td>
|
||||
<td>
|
||||
<input type="button" value="Remove" class="btn btn-primary" ng-click="removeMember(x.id)"/>
|
||||
<input type="button" value="Remove" class="btn btn-warning" ng-click="delete_member(x.id)"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<h1> Lisää jäsen </h1>
|
||||
|
||||
<div id="input_form">
|
||||
<form name="memberForm" ng-submit="submitForm()">
|
||||
<form name="memberForm">
|
||||
<div class="form-group">
|
||||
<label>Etunimi: </label>
|
||||
<input id="firstNameField" required type="text" placeholder="Sähkö" class="form-control" ng-model="firstName"></input>
|
||||
@@ -15,7 +15,7 @@
|
||||
<input id="emailField" required type="text" placeholder="sahko.insinoori@aalto.fi" class="form-control" ng-model="email"></input>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>AYY jäsen: </label>
|
||||
<label>AYY j�sen: </label>
|
||||
<input type="checkbox" id="AYY" value="0" ng-model="AYY"></input>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
|
||||
app.controller("getController", function($scope, $http){
|
||||
$scope.members = [];
|
||||
$http.get("/members/api/members").then(function(response){
|
||||
$scope.members = response.data;
|
||||
});
|
||||
$scope.delete_member = function(id, $http) {
|
||||
$http.delete("/members/api/member/" + id);
|
||||
};
|
||||
});
|
||||
|
||||
app.controller("postController", function($scope, $http) {
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<ul class="sidebar-nav">
|
||||
<li><a href="#/list">Listaa jäsenet</a></li>
|
||||
<li><a href="#/add">Lisää jäsen</a></li>
|
||||
<li><a href="#/add">Jäsenhakemukset</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /#sidebar-wrapper -->
|
||||
|
||||
Reference in New Issue
Block a user