Category : rest

In my angular application I have created the form fields(more no of fields) using angular formly .ts // Inquiry form inquiryForm = new FormGroup({}); inquiryModel: any = {}; inquiryOptions: FormlyFormOptions = {}; inquiryFields: FormlyFieldConfig[] = [ { key: ‘buisnessName’, type: ‘input’, templateOptions: { label: ‘Business Name’, minLength: 3 }, validation: { messages: { pattern: ‘Please ..

Read more

I have called the API in service .service.ts return this.http.post(this.baseUrl + ‘/api/installer/inquiry’, inquiryData , { headers: new HttpHeaders({ ‘Content-Type’: ‘application/json’, ‘Access-Control-Allow-Origin’: ‘*’ }) } ); } .component.ts var userId = localStorage.getItem(‘idvalue’) if (this.inquiryModel.invalid) { this.inquiryModel.markAllAsTouched(); if (this.selectedIndex != this.maxNumberOfTabs) { this.selectedIndex = 0; return; } } this._inquiryService.createInquiry(this.inquiryModel).subscribe(resp => { console.log(resp); }, err => { console.log(err); ..

Read more

I am new to full-stack application .I had used angular11 in Front-End and Spring-boot Gradle project with JPA rest-service in Back-End. My Angular Method addTodos(todo:Todos) { return this.http.put(‘http://localhost:8082/addTodo’,JSON.stringify(todo)) } My Rest Service @PutMapping(path="/addTodo" ,consumes=MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Todo> addTodo(@RequestBody Todo todo) { todoservice.addTodos(todo); return new ResponseEntity<Todo>(todo,HttpStatus.OK); } My Error in browser is:Access to XMLHttpRequest at ‘http://localhost:8082/addTodo’ from ..

Read more