From 0af60808069f9408b4526e8972b666941fdfc592 Mon Sep 17 00:00:00 2001 From: Daniel Rainer <daniel.m.rainer@student.uibk.ac.at> Date: Fri, 19 Feb 2021 13:25:41 +0100 Subject: [PATCH] Fix typos in front-end --- .../app/search/service/search-service.ts | 2 +- .../teaserContent/teaserContent.component.ts | 60 +++++++++---------- 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/main/webapp/app/search/service/search-service.ts b/src/main/webapp/app/search/service/search-service.ts index e791d3c04..8fb2dc0f3 100644 --- a/src/main/webapp/app/search/service/search-service.ts +++ b/src/main/webapp/app/search/service/search-service.ts @@ -33,7 +33,7 @@ export class SearchService { const options: HttpParams = new HttpParams(); options.append('keyWordPrefix', prefix); return this.http.get<Array<string>>(this.resourceProgrammingLanguageAutoCompleteDetails, { - params: new HttpParams().set('progammingLanguagePrefix', prefix), + params: new HttpParams().set('programmingLanguagePrefix', prefix), }); } diff --git a/src/main/webapp/app/teaserContent/teaserContent.component.ts b/src/main/webapp/app/teaserContent/teaserContent.component.ts index 8b295c6c2..d122693d8 100644 --- a/src/main/webapp/app/teaserContent/teaserContent.component.ts +++ b/src/main/webapp/app/teaserContent/teaserContent.component.ts @@ -5,46 +5,40 @@ import { SearchService } from 'app/search/service/search-service'; @Component({ selector: 'jhi-teaser-content', templateUrl: './teaserContent.component.html', - styleUrls: ['./teaserContent.component.scss'] + styleUrls: ['./teaserContent.component.scss'], }) - export class TeaserContentComponent implements OnInit { - public keywords: Array<String> = new Array<String>(); public contributors: Array<String> = new Array<String>(); public programmingLanguages: Array<String> = new Array<String>(); - constructor( - private searchService: SearchService - ) { } + constructor(private searchService: SearchService) {} ngOnInit(): void { - - this.searchService.getKeywordsAutoComplete('') - .subscribe( - (data: Array<string>) => { - this.keywords = data; - } - , - () => {alert("Initializiation of keywords failed");} - ); - - this.searchService.getProgrammingLanguageAutoComplete('') - .subscribe( - (data: Array<string>) => { - this.programmingLanguages = data; - } - , - () => {alert("Initializiation of programming languages failed");} - ); - this.searchService.getContributorAutoComplete('') - .subscribe( - (data: Array<string>) => { - this.contributors = data; - } - , - () => {alert("Initializiation of contributors failed");} - ); + this.searchService.getKeywordsAutoComplete('').subscribe( + (data: Array<string>) => { + this.keywords = data; + }, + () => { + alert('Initialization of keywords failed'); + } + ); + + this.searchService.getProgrammingLanguageAutoComplete('').subscribe( + (data: Array<string>) => { + this.programmingLanguages = data; + }, + () => { + alert('Initialization of programming languages failed'); + } + ); + this.searchService.getContributorAutoComplete('').subscribe( + (data: Array<string>) => { + this.contributors = data; + }, + () => { + alert('Initialization of contributors failed'); + } + ); } - } -- GitLab