1
パスのリストを持っていますCanActivate
をいくつかのパスを除くすべてのパスに適用したいのですが、何らかのパスを破棄する方法があります。 現在、すべてのURLにcanActivate
を適用しています。多くのURLがある場合、すべてのURLに適用したくない場合は、親のパスに適用します。 しかし、私たちが親に申請すると、それはすべての子供にも適用されます。子供たちの一部を捨てる方法はありますか?適用方法一部を除くすべてのパスにCanActivateを適用します
const routes: Routes = [
{ path : '', component: UsersListComponent, canActivate:[AuthenticationGuard] },
{ path : 'add', component : AddComponent, canActivate:[AuthenticationGuard]},
{ path : ':id', component: UserShowComponent },
{ path : 'delete/:id', component : DeleteComponent, canActivate:[AuthenticationGuard] },
{ path : 'ban/:id', component : BanComponent, canActivate:[AuthenticationGuard] },
{ path : 'edit/:id', component : EditComponent, canActivate:[AuthenticationGuard] }
];
ねえ、ソリューションはあなたのために機能しましたか? –