相关疑难解决方法(0)

rxjs:EmptyError:序列中没有元素

我收到了一个错误

当我转到localhost:8080时,'EmptyError:序列中没有元素'错误.

我看到了线程Angular 5 EmptyError:在制作子路由时没有顺序的元素,但似乎没有任何答案适用.

我有"rxjs": "^5.5.6",在我的路线中,我尝试添加,pathMatch: 'full',但仍然显示错误.

我的app-routing-module.ts的摘录

const routes: Routes = [
    {
        pathMatch: 'full', /* added recently for test purposes*/
        path: '',
        component: RootComponent,
        canActivate: [AuthGuard],
        children: [
            {
                pathMatch: 'full', /* added recently for test purposes*/
                path: '',
                component: RootLoggedComponent
            },
Run Code Online (Sandbox Code Playgroud)

这只发生在最近,我添加了一个http拦截器:

export class myInterceptor implements HttpInterceptor {
    constructor(
        private router: Router
    ) {

    }

    intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {

        return next.handle(request)
            .pipe(catchError(err => {
                if (err …
Run Code Online (Sandbox Code Playgroud)

rxjs angular angular6

8
推荐指数
1
解决办法
2480
查看次数

标签 统计

angular ×1

angular6 ×1

rxjs ×1