Cros Origin + Spring + Angular 4/5

1

I have a problem with my restful service with spring. Even after enabling CORS, I can not connect to my angled application.

@CrossOrigin
public class UsuarioController {

    @Autowired
    UsuarioService service; 

    @RequestMapping(method = RequestMethod.GET, value = "/lista_todos_usuarios", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<Collection<Usuario>> buscaTodosUsuarios() {
        Collection<Usuario> usuarios = service.buscaTodosUsuarios();
        return new ResponseEntity<>(usuarios, HttpStatus.OK);

    }
}

The message below is displayed in the browser console.

    
asked by anonymous 20.02.2018 / 14:00

0 answers