Я получаю эту ошибку в консоли браузера, и у меня есть ссылки маршрутизации в боковой навигации (угловой материал), которые даже не переходят к ссылкам маршрутизатора. Я уверен, что все настроено правильно.
ОШИБКА:
ОШИБКА TypeError: t.resolve не является функцией
на SafeSubscriber._next (router.js: 4123)
в SafeSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.SafeSubscriber .__ tryOrUnsub (Subscriber.js: 196)
в SafeSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.SafeSubscriber.next (Subscriber.js: 134)
на Subscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber._next (Subscriber.js: 77)
в Subscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber.next (Subscriber.js: 54)
в SwitchMapSubscriber.push ../ node_modules / rxjs / _esm5 / internal / operator / switchMap.js.SwitchMapSubscriber.notifyNext (switchMap.js: 72)
в InnerSubscriber.push ../ node_modules / rxjs / _esm5 / internal / InnerSubscriber.js.InnerSubscriber._next (InnerSubscriber.js: 15)
в InnerSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber.next (Subscriber.js: 54)
в CatchSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber._next (Subscriber.js: 77)
в CatchSubscriber.push ../ node_modules / rxjs / _esm5 / internal / Subscriber.js.Subscriber.next (Subscriber.js: 54)
----- Football.HTML -----
<div class="container">
<mat-toolbar color="primary" class="nav-toolbar">
<button style="margin-bottom:17px" mat-icon-button (click)="sidenav.toggle()"><mat-icon>menu</mat-icon></button>
<h1 class="nav-app-name">Fantasy Football</h1>
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav role="navigation" #sidenav>
<mat-nav-list>
<a mat-list-item routerLinkActive="active" routerLink='/create-league'>Create League</a>
</mat-nav-list>
<app-sidenav-list (sidenavClose)="sidenav.close()"></app-sidenav-list>
</mat-sidenav>
<mat-sidenav-content>
<app-header (sidenavToggle)="sidenav.toggle()"></app-header>
<router-outlet></router-outlet>
</mat-sidenav-content>
</mat-sidenav-container>
----- Football.TS пусто -----
----- приложение-routing.module.ts -----
const appRoutes: Routes = [{ path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'create-league', component: CreateLeagueComponent}
];
@NgModule({
exports: [ RouterModule ],
declarations: [],
imports: [ RouterModule.forRoot(appRoutes), CommonModule],
})
export class AppRoutingModule { }
------ app.module.ts -----
const modules = [ HttpClientModule, HttpModule, ReactiveFormsModule, MatToolbarModule, MatSidenavModule, MatNativeDateModule,
MatListModule, FormsModule, BrowserAnimationsModule, AppRoutingModule];
@NgModule({
declarations: [
AppComponent,
FootballComponent
],
imports: [
modules,
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' })
],
exports: [
modules,
BrowserModule
],
bootstrap: [ AppComponent ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);