added edit button for jasenlista
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
<td>{{ x.jas }}</td>
|
||||
<td>{{ x.POR }}</td>
|
||||
<td>
|
||||
<a href="#/edit/{{x.id}}"<input type="button" value="Edit" class="btn btn-info"/></a>
|
||||
<input type="button" value="Remove" class="btn btn-danger" ng-click="delete_member(x.id)"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -34,3 +34,13 @@ app.controller("postController", function($scope, $http) {
|
||||
$http.post("/members/api/member", {"first_name":$scope.firstName, "last_name":$scope.lastName, "email":$scope.email, "AYY":$scope.AYY, "jas":$scope.JAS, "POR":$scope.POR});
|
||||
}
|
||||
});
|
||||
app.controller("editController", function($scope, $http, $route, $routeParams) {
|
||||
$scope.member = {"id": $routeParams.id};
|
||||
$http.get("/members/api/member/"+$scope.member.id).then(function(response){
|
||||
scope.member = response.data;
|
||||
});
|
||||
|
||||
$scope.send = function() {
|
||||
$http.put("/members/api/member", $scope.member);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user