Skip to content
Advertisement

Basic Spring Boot with Angular

I am trying to get a message printed to my web console when I click a button in my Angular UI.

So far I have done:

My Angular Side:

Button:

JavaScript

My .ts file:

JavaScript

My Springboot side:

SpringSecurityConfig.java:


JavaScript

Controller

JavaScript

Error That I am getting in Web console:

zone.js:3243 POST http://localhost:8080/jpmorgan/editquestionSet 401 core.js:1449 ERROR HttpErrorResponse {headers: HttpHeaders, status: 401, statusText: “OK”, url: “http://localhost:8080/jpmorgan/editquestionSet”, ok: false, …}

Instead of error, I want a response to coming from the spring app:

** Questions Added Successfully **

Advertisement

Answer

The following means you are requiring authentication.

JavaScript

Try :

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement