Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Injectable()
- export class SlidesService {
- private requestUrl: string;
- constructor(
- @Inject(AppConfig) private config: AppConfig,
- @Inject(HttpClient) private http: HttpClient) {
- this.requestUrl = this.config.restRoot + listSlidesUrl;
- }
- getSlide(deck: string, slide: string): Observable<string> {
- const headers: HttpHeaders = new HttpHeaders({'Accept': 'text/html'});
- const thisUrl: string = this.requestUrl + '/' + deck + '/' + slide;
- return this.http.get<string>(thisUrl, { headers: headers });
- }
- }
- export class SlidePreviewComponent implements OnInit {
- @Input() slide: string; /* Identifier for the slide */
- @Input() deck: string;
- slideHtml: string;
- constructor(private slideService: SlidesService) {
- }
- ngOnInit(): void {
- this.slideService.getSlide(this.deck, this.slide)
- .subscribe(html => this.setSlideHtml(html) );
- }
- setSlideHtml(html: string) {
- this.slideHtml = html;
- console.log(html);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement