我正在使用 angular7 并为管理员进行路由,但它给出错误'字符串不可分配给类型'任何人都可以告诉这个错误是什么以及我该如何解决它?
错误截图:-
管理员路由.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { adminComponent } from './admin.component';
const routes: Routes =[
{
path: 'admin',
component:adminComponent,
children: [
{path: '', component: 'loginComponent', pathMatch: 'full'},
{path: 'dashboard', component: 'dashboardComponent'}
//{path: 'login', component: 'loginComponent'}
]
}
];
export const adminComponents = [
adminComponent
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class adminRouterModule{
}