added edit button for jasenlista

This commit is contained in:
okalintu
2016-08-08 19:52:23 +03:00
parent 11316ef425
commit 43bc51377d
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -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>
+10
View File
@@ -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);
}
});