intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next
.handle(req)
.pipe(
map((event: HttpEvent<any>) => {
if (event instanceof HttpResponse) {
return event.clone({
body: event.body.data
});
}
return event;
}
),
catchError((error: HttpEvent<any>) => {
if (error instanceof HttpErrorResponse) {
const url = error.url ? error.url : '';
const newError = new HttpErrorResponse({
error: error.error.data,
status: error.status,
statusText: error.statusText,
url: url
});
return throwError(newError);
}
return throwError(error);
})
);
}
comment: вфыафвыафыавф
comment_post_ID: 86
comment_parent: 0
_wp_unfiltered_html_comment: e9e3ed8ebc
comment: Тест
author: Тест
email: mail@mail.ru
url: mail.ru
comment_post_ID: 86
comment_parent: 0
// Require an action parameter
if ( empty( $_REQUEST['action'] ) )
die( '0' );
deleteRecord(event: IEvent): void {
this.dialog.confirm(
'Подтвердите Ваше действие',
`Подтвердите удаление записи <strong>${event.title}</strong>`)
.do(success => success)
.mergeMap(confirm => this.deleteService.deleteRecord(event.id))
.subscribe(
success => {
this.alert.info(`Событие - ${event.title} удалено!`);
this.logger.log('delete history event', success);
},
error => {
this.logger.error('delete history event', error);
}
);
}
/**
* Add doc content to host element and build it out with embedded components.
*/
protected render(doc: DocumentContents): Observable<void> {
console.log(doc);
let addTitleAndToc: () => void;
return this.void$
// Security: `doc.contents` is always authored by the documentation team
// and is considered to be safe.
.do(() => this.nextViewContainer.innerHTML = doc.contents || '')
.do(() => addTitleAndToc = this.prepareTitleAndToc(this.nextViewContainer, doc.id))
.switchMap(() => this.embedComponentsService.embedInto(this.nextViewContainer))
.do(() => this.docReady.emit())
.do(() => this.destroyEmbeddedComponents())
.do(componentRefs => this.embeddedComponentRefs = componentRefs)
.switchMap(() => this.swapViews(addTitleAndToc))
.do(() => this.docRendered.emit())
.catch(err => {
const errorMessage = (err instanceof Error) ? err.stack : err;
this.logger.error(`[DocViewer] Error preparing document '${doc.id}': ${errorMessage}`);
this.nextViewContainer.innerHTML = '';
return this.void$;
});
}
/**
* Embed components into the specified element:
* - Load the necessary modules (if any).
* - Prepare the component factories.
* - Instantiate the components.
*
* Return the list of `ComponentRef`s.
*/
embedInto(elem: HTMLElement): Observable<ComponentRef<any>[]> {
const requiredComponents = Object.keys(this.embeddedComponentsMap)
.filter(selector => elem.querySelector(selector))
.map(selector => this.embeddedComponentsMap[selector]);
const factoriesReady = requiredComponents.map(compsOrPath => this.prepareComponentFactories(compsOrPath));
return !requiredComponents.length
? of([])
: of(undefined)
.switchMap(() => Promise.all(factoriesReady))
.switchMap(() => [this.createComponents(elem)]);
}
setInterval(function () {
show();
//console.log(mp3List);
play(mp3List);
}, 4000)
audioElements[i - 1].addEventListener('ended', function() {
<b> audioElements[i].play()</b> //на этом пункте ошибка валиться
list = list.slice(1)
})
$(document).ready(function () {
setInterval(function () {
show();
console.log(mp3List);
play(mp3List);
}, 4000);
});
Error:(38, 37) TS2339: Property 'clone' does not exist on type 'HttpErrorResponse'.