это мой сервис
import { Injectable } from '@angular/core';
import { GenericPostService } from 'app/shared/services/generic.post.service';
@Injectable({
providedIn: 'root'
})
export class FaqService {
constructor(
private readonly genericPostService: GenericPostService
) { }
async getFaqContent() {
return this.genericPostService.post('faq', 'getFAQContent');
}
}
это мой компонент
import { Location, ViewportScroller } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { FaqService } from '@myse/faq/faq.service';
import { Subscription } from 'rxjs';
@Component({
providers: [Location],
selector: 'myse-faq',
styleUrls: ['./faq.component.scss'],
templateUrl: './faq.component.html'
})
export class FaqComponent implements OnInit, OnDestroy {
faqSectionList: any;
subscription: Subscription;
gotoPageWithRank: any;
gotoPagedivWithRank: any;
identifylink: any;
rank: any;
divName: any;
FAQSubsectionDisplayBean = {
}
constructor(
private readonly faqservice: FaqService,
private readonly router: Router,
private readonly route: ActivatedRoute,
private readonly viewportScroller: ViewportScroller
) { }
async ngOnInit() {
this.faqSectionList = this.faqservice.getFaqContent();
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
gotoPageDiv() {
window.scroll({
top: 0,
left: 0,
behavior: 'auto'
})
}
gotoPagedivwithRank(elementId: any): void {
this.viewportScroller.scrollToAnchor(elementId);
}
gotoPageDivWithURL(url) {
this.divName = String(url);
}
identifyLink(link) {
if (link == null) {
this.identifylink = null;
return this.identifyLink;
} else {
if (link.substring(0, 3) === 'faq') {
this.rank = link.substring(3);
} else {
this.identifylink = null;
return this.identifylink;
}
}
}
}
это мой шаблон кода
это коды, я не могу получить данные, вы, ребята, помогите, пожалуйста, боролись уже несколько дней !! Я хочу создать страницу часто задаваемых вопросов и API-интерфейс вызова службы из бина java ............................... .................................................. ...