This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
teaserContent.component.ts 1.25 KiB
Newer Older
import { Component, OnInit } from '@angular/core';

import { SearchService } from 'app/search/service/search-service';

@Component({
  selector: 'jhi-teaser-content',
  templateUrl: './teaserContent.component.html',
Daniel Rainer's avatar
Daniel Rainer committed
  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>();

Daniel Rainer's avatar
Daniel Rainer committed
  constructor(private searchService: SearchService) {}
Daniel Rainer's avatar
Daniel Rainer committed
    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');
      }
    );