对象常值只能指定已知属性,而且'text'不存在于型别'Route'中。
源代码/应用程序/应用程序-路由.模块.ts
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'detail/:id', component: HeroDetailComponent },
{ path: "dashboard", component: DashboardComponent, text: "Dashboard" },
{ path: "heroes", component: HeroesComponent, text: "Heroes" },
];
当我运行update命令进入Angular v15时,出现了这种情况:ng update @angular/core@15 @angular/cli@15
.
1条答案
按热度按时间ep6jt1vc1#
我修复后,看到这一点的突破性变化:https://angular.io/guide/update-to-version-15#the-title-property-is-required-on-activatedroutesnapshot
将
text
更改为title
似乎消除了错误。源代码/应用程序/应用程序路由.模块.ts [旧版]
源代码/应用程序/应用程序路由.模块.ts [新]