Skip to content

Commit

Permalink
docs: adding debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
ijz953 committed Mar 13, 2019
1 parent 63adf95 commit 315ab6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export class EventListComponent {
}

constructor(private eventService: EventService) {
console.log('hello2');
this.eventService.events.subscribe(value => {
console.log('hello3' + value);
const displayEvents: DisplayEvent[] = value.map(event => {
const startDate = event.startDate ? new Date(event.startDate) : undefined;
const endDate = new Date(event.endDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { ConnectableObservable, Observable } from 'rxjs';
import { tap, publishLast } from 'rxjs/operators';
import { tap, publishLast, map } from 'rxjs/operators';

import { CONTENT_URL_PREFIX } from 'app/documents/document.service';
import { Event } from './event.model';
Expand All @@ -18,8 +18,10 @@ export class EventService {
}

private getEvents(): Observable<Event[]> {

const events = this.http.get<Event[]>(resourcesPath).pipe(
console.log('getEvents')
const events = this.http.get<any>(resourcesPath).pipe(
tap(() => console.log('serviceok')),
map(event => event as Event[]),
tap(event => console.log('service: ' + event)),
publishLast(),
);
Expand Down

0 comments on commit 315ab6a

Please sign in to comment.