Delete records from the base with angular

0

I have a problem, I can not delete the records in the database. In my project I have the following code:

Controlador:

 $scope.typeKeyDelete = function(index){
    $scope.loadTypeKeyFromList(index);
    $scope.typeKey.$delete();
    $scope.typeKeyList();
};

 Controlador de java:

 @RequestMapping(value = "/type_key/{id}", method = RequestMethod.DELETE)
  public ResponseEntity<TypeKey> delete(HttpServletRequest 
  httpServletRequest, 
  @PathVariable("id") int id){
    typeKeyDAO.delete(id);
    return new ResponseEntity<TypeKey>(HttpStatus.OK);
}

Vista:
 <li data-ng-if="isPermited('TYPE_KEY_DELETE')"><a href="" title="" data-ng-click="typeKeyDelete($index)" onclick="return confirm('¿Está seguro que desea eliminar el tipo de llave?'), location.reload()">Eliminar</a></li>
    
asked by Carmen A. 07.04.2017 в 18:48
source

0 answers